How to play sound from network?
See original GitHub issueHi everyone, I would like to know how to play a sound from a given url
I’m trying to run the following method which runs a local file and it also doesn’t work
var whoosh = new Sound('advertising.mp3', Sound.MAIN_BUNDLE, (error) => {
if (error) {
console.log('failed to load the sound', error);
return;
}
// loaded successfully
console.log('duration in seconds: ' + whoosh.getDuration() + 'number of channels: ' + whoosh.getNumberOfChannels());
});
function onPlaySound() {
console.log('Sound started playing!');
whoosh.play((success) => {
if (success) {
console.log('successfully finished playing');
} else {
console.log('playback failed due to audio decoding errors');
}
});
}
Would be grateful if someone could provide me with an example of how to run an mp3 from a url
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
How to play music through the Network speaker with a ... - Sony
Right-click the mouse and select Play To. Select the Network speaker. Using a computer with the Windows® XP OS or the Windows Vista®...
Read more >Stream audio via LAN (Local Area Network) - VLC Only
Stream audio/mic from PC to PC via LAN (Local Area Network ) - VLC Only In In this video, I'll show how to...
Read more >How to play music through the Network speaker with a ...
Using the computer, click Start. · Select All Programs. · Select Windows Media Player. · Select Library. · Select Media Sharing. · Select...
Read more >Stream Windows audio over the network
Go into Control Panel > Sound > Recording > Right click in the devices list > Show disabled devices > Right click on...
Read more >Listening to music on a PC via network connection (Windows ...
Connect the speaker and PC to your network. · Tap the NETWORK button. · Right-click on the Start screen of the PC. ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try this, inside your component
You must wait until the sound is loaded. The best way I found was to start playing in the oncomplete handler: