Audio support


#1

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)?


#2

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:


#3

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

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


#4

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


#5

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?


#6

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.


#7

thank you. jake.


#8

Is there a target date or version for audio support?

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


#9

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.


#10

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


#11

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


#12

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


#13

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?


#14

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.


#15

@Bent, perfect. I should have seen that.


#16

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

thank you


#17

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


#18

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


#19

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


#20

How can i do that?..