Audio support

As far as I’ve seen in the documentation, there’s no native support for audio yet. My first Fuse project would be to make an audio player to play online radios, so any word on when this will be available? Also, which audio formats will be available to play (both as files on the device and as streaming)?

Hi!

You are right that there are no abstractions for this yet, but you do have direct access to all iOS and Android APIs from Uno code. A well behaved audio player probably needs deep per-platform OS integration.

We will be releasing some examples soon on how to use the iOS and Android APIs directly, but in short, you simply add references to these packages in your project:

  • Android
  • Experimental.iOS
  • ObjC

Abstractions for background tasks like sound playback is also in the pipeline :slight_smile:

Abstractions for background tasks like sound playback is also in the pipeline :slight_smile:

That’s excellent news! :slight_smile: Any ETA?

No promises on exact dates, but we have top men working on it right now :slight_smile:

hi! we need audio feature too. any update?

i’m new with Android and Uno, so i have no idea how to access android api directly. can i get a example play and stop simple wav file?

Hi cio, we’re still working on getting these abstractions in place. In the meantime, while this isn’t exactly the example you asked for, one of our users created a gist to play a system sound on iOS, and it shows how you might access the native API’s through Uno code pretty well. That should at least point you in the right direction.

thank you. jake.

Is there a target date or version for audio support?

BTW, I don’t think that gist works anymore…

We have not set any target date. It has been on hold for a while, but I am pretty sure we are going to get to it soon.

Hello, any updates on this? An ETA maybe? Please :wink:

Sound playback (as in: playSound() , not streamMeSomeCoolSongs() ) is in active development right now. We’re expecting to get it out in February. :slight_smile:

Awesome Remi, it’s exactly what I need. Thanks!

So as I understand it, doing stuff like loading a sound file from a url and playing it back is something we’d have to write ourselves. Is that right?

PlaySound was released in Fuse version 0.34, and you can find the documentation here: https://www.fusetools.com/docs/fuse/playsound

As for loading the sound file from a URL, you can use existing functions like fetch for that.

2 Likes

@Bent, perfect. I should have seen that.

Hello @Bent, i search the “fetch” method from documentation but didn’t found, could you point me any url please ?

thank you

i search the “fetch” method from documentation but didn’t found, could you point me any url please ?

fetch() is standard javascript functionality and nothing Fuse-specific. You’ll find docs here and here

Thank you, last question please, is playsound is adapted to play streaming audio (like existing webradio) ? , because from documentation i saw this : “This is intended for playing the small one-shot sounds like button-clicks & notification chimes”, or there is another workaround?
thank you

Hi all! I have found Fuse.StreamingPlayer unofficial library! At next months i will be tested it.

How can i do that?..