Play external audio assets

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I'm working on a project where a lot of audio assets are needed. I have embedded all of them into the Fusion project. There's more than 500 Mb of raw .wav files, and Fusion has a hard time handling it. Saving and compiling the project takes ages (more than 5 minutes).

    There's also a lot of graphic assets. But I'm able to load and display them as external files, at runtime, thanks to the Active Picture object.

    I would like to the same with audio assets, but this doesn't seem to be possible. The Sound object's action "Play sample file" isn't compatible with HTML5. And the HTML5 video object doesn't load wav, mp3 or ogg files.

    Any help or advice is greatly appreciated.

  • And play sound for streaming?


    <audio controls>

    <source src="Please login to see this link." type="audio/mpeg" />

    Tu navegador no es compatible con esta característica.

    </audio>

    Please login to see this link.
    Please login to see this link.

  • Could you please elaborate on how I would implement this in Fusion?

    Anyway, after some more tests I can tell that the HTML5 Video object can actually handle audio playback. I've been able to play ogg, mp3 and wav. Super thanks Clickteam! :)

  • I used it with Android Exporter, inside the function:

    "Web View Object" reading the code with "Load HTML"

    Do not know exactly what it would be in HTML5 Exporter

    Congratulations on having found another solution.

    regards

    Please login to see this link.
    Please login to see this link.

  • Unfortunately I'm facing a problem, on iOS the HTML5 Video Object opens the QuickTime player/app to play the audio files. I have tried to hide the HTML5 Video Object by its property or by an action, checked the property "Display as sprite", and set its Width and Height to 0. The QuickTime player/app still opens.

    I'd like to know if it's possible to enable/disable the use of the QuickTime player/app on iOS devices when playing media files with the HTML5 Video Object? If that's possible, I think that a new property for the HTML5 Video Object would be nice.

  • That would be ace Ben. :)

    To make it more clear, I am trying to play audio files located in the resources folder of the HTML5 app. With the Active Picture object I already load pictures from that folder, and it's working great.

    I have made more tests by playing sounds normally with the Sound object. I found out that with my (now old) iPod Touch 4th gen, for any given frame if the total filesize of the audio is too big to load, the app sort of crashes and Safari closes. I think that this is due to the device having low memory capabilities or something.

    So for me, there's really a need of being able to load/play *external* audio assets. So that I can load each audio file separately, instead of loading all of them and take the risk to make the browser crash in case of a device with low memory capabilities.

    By the way, I think that at runtime I could decide which audio file types to load (m4a, mp3, ogg) by using the expression "Can play mime type" of the HTML5 Video object.

    I've also filled a feature request via the bugbox:
    Please login to see this link.

    And while I was looking for a solution, I've bookmarked a few links related to iOS/Safari that might be useful:
    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

  • I was finally able to play external audio files by using a JavaScript Sound API called SoundManager 2: Please login to see this link.

    Attached to this post is a basic implementation of it. Most of the work is done in the .html file where you must import the library, declare the sound objects and define the functions. Then from your Fusion app you call the javascript functions with the HTML5 object. This must be working on most devices and browsers. For a wider compatibility it's best to provide the sounds in both MP3 and OGG formats.
    There are a few limitations though, you're welcome to read the documentation of SoundManager 2 for more information.

  • Bonjour Olivier ,
    j'ai trouvé cette discussion après une recherche sur la possibilité de stocker ( et appeler depuis le runtime html 5 ) des sons dans un dossier externe.
    J'ai étudié le fichier zip contenant le plugin soundmanager ; je ne suis pas développeur ( javascript ou autre) et j'aurais besoin d'une petite aide svp.
    1) j'ai regardé d'abord le fichier index.html ; je vois que c'est là que tu "déclares" tes fichiers mp3 ( id et emplacement).
    Dans mon cas ( une appli éducative sur les verbes irréguliers) , il y a environ 900 sons enregistrés ( un son : un verbe ) .
    Faut-il donc déclarer les 900 sons dans le fichier index.html , ou aurais-tu trouvé depuis une méthode plus simple ?
    2) As-tu modifié les fichiers runtime.js et sounmanager....js ?
    Merci pour ton aide !
    If anyone needs translation for this post , please ask and I'll provide it, no problem.

    Please login to see this link.

  • 1. Oui, d'après moi il faut déclarer chaque son individuellement. Je viens de relire succintement la documentation de SoundManager 2, et je ne pense pas qu'il existe une méthode plus simple. Cependant je ne suis pas un expert en JavaScript.

    2. Non, je n'ai pas modifié ces fichiers.

  • Merci pour ce nouvel exemple !
    Si je comprends bien , dans fusion , le paramètre "string" qui est ajouté ( le nom du fichier audio sans extension ) via l'objet html 5 est "automatiquement" associé , dans le fichier index.html , à la variable "snd" dans le bloc ci-dessous :

    function playAudio(snd) {
    soundManager.play('mysound',{
    url: 'audio/'+snd+'.mp3'
    });
    }

    En effet, je n'ai vu aucune référence à "snd" dans le mfa , donc la liaison semble être "automatique"...
    Il me faut encore faire un test en situation réelle , en envoyant ton exemple sur mon espace web pour test , mais d'ores et déjà merci encore pour ton aide!

    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!