Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700
My Carrier: Bell, Rogers

play remote audio streams

Anyone have any idea on playing remote audio streams? I haven't seen any samples of this anywhere.

 

I've seen remote playing of mp3's and local audio etc but not remote audio streams.

 

My guess is it will require some C++ library as a hack.

 

I would prefer a solution within cascades.

 

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Retired
Posts: 127
Registered: ‎02-27-2012
My Device: Bold
My Carrier: Rogers

Re: play remote audio streams

 

Hi 

            MediaPlayer {
                id: myPlayer
                sourceUrl: "http://webDomainNameExample.com/file.mp3"
                property bool isPlaying: false
                onMediaStateChanged: {
                    if (myPlayer.mediaState == MediaState.Started) {
                        playButton.text = "Pause"
                        isPlaying = true;
                    } else if (myPlayer.mediaState == MediaState.Paused) {
                        playButtonUrl.text = "Play"
                        isPlaying = false;
                    } // onMediaStateChanged
                }

 

Developer
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700
My Carrier: Bell, Rogers

Re: play remote audio streams

Thanks for the reply.

 

After doing some additional searching I did see some others comment about this.

 

I thought all of these examples refered to playing remote audio files and not for streaming and the api call will attempt to read the entire file before actually playing anything and for streaming we would end up with an out of memory error.

 

Maybe that was in a previous sdk. 

 

Are you aware of any restriction to the stream type besides the spaces in url issue? Will it play mp3, ogg, acc streams at any bitrate?

 

thanks for your help.

 

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Retired
Posts: 127
Registered: ‎02-27-2012
My Device: Bold
My Carrier: Rogers

Re: play remote audio streams

 

Hi 

The formats you mentioned should all be supported. The information about the supported formats and codecs are  listed online here:


https://developer.blackberry.com/devzone/develop/supported_media/bb_media_support_at_a_glance.html#k...

 

The high level overview of the media support page is here: https://developer.blackberry.com/devzone/develop/supported_media/supported_media_on_bb_devices.html

 

Cheers,
Rashid

 

 

Developer
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700
My Carrier: Bell, Rogers

Re: play remote audio streams

Thanks.

 

Are all formats listed are capable of being played as a local file and through remote audio streaming?

 

I seem to be having issues with OGG streams for one and it is listed as a compatible format.

 

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Highlighted
Retired
Posts: 127
Registered: ‎02-27-2012
My Device: Bold
My Carrier: Rogers

Re: play remote audio streams

Hi BerboInc,

 

Yes, the listed formats should work for both local and remote URLs (i.e. streaming). Can you share any actual URL, code snippet and log/trace/error outputs?

 

Thanks,

Rashid

Developer
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700
My Carrier: Bell, Rogers

Re: play remote audio streams

got an unsupported format error playing this one but worked fine with mp3 and aac+ streams.

 

Button {

   id: but

   text: "Play"

   onClicked: {                                              

      myPlayer.setSourceUrl("http://streamer.radiocampusbruxelles.org:8000/stream_low.ogg");

      myPlayer.play()

   }

}

 

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
New Contributor
Posts: 7
Registered: ‎12-19-2012
My Device: developer
My Carrier: developer

Re: play remote audio streams

Hi Rashid

Is there a way we could record the audio stream from the internet?

One way I could think of is having a media player play that and an AudioRecorder record that, but it will not work if the media is being played on a headset.

What is your suggestion for this?

Thanks!