Now like does the question says, I need a way to play a small sound that lasts for like 1 second or less to play really quickly/fast in my Xamarin Android app. I am using .mp3 files and MediaPlayer class, is there any way to get as fast as possible to play a particular sound?
Related
I would like to develop an app with which you can control the focus of individual sound outputs, so that you can, for example, play music with Spotify and at the same time play a video via Youtube, which then no longer has any sound. Is something like that even possible?
Thanks for an answer
Actually i'm trying to play a sound inside my raw folder in the project,
The issue is that the device for which i'm developing the app doesn't support MediaPlayer and by following this guide in which the user use AudioTrack, the app just freeze every time the sound play.
So which should be the optimal alternative to MediaPlayer? The sounds i'm trying to play in my app are like "alert" sounds
I'm developing a Chromecast application (receiver, HTML5 and Javascript) which communicates with an Android app, all is fine, but I have a problem trying to play two "sounds" at a time in the receiver.
It's a kind of game where I need to play a song at the beggining and play some sound effects during it.
Is this possible? And if it is anyone could help me to do it? I have tried it and it works nice in the browser but in the Chromecast only one of the "sound" is played, the song or the effect, never both.
Thank you very much
You cannot have more than one active Media Element in your DOM in chromecast. For what you want to do, however, you can use Web Audio APIs and accomplish the same for short audio files.
I've been trying to make multiple sounds work simultaneously but I kept getting errors like Sample not ready and Error creating AudioTrack. Though I've taken care of the first error, the other error persists.
I'm using two mp3 files, that are away above 5 mb(>4 minutes) and thus was wondering if SoundPool is the right way to go about it? I can use Media Manager but it doesn't let me play multiple files simultaneously.
SoundPool is recommended for <1MB sound clips, so I'd use MediaPlayer in your case. You can call the following for each sound and they will play simultaneously:
MediaPlayer.create(YourActivity.this, R.raw.your_sound).start();
Or you can create multiple MediaPlayer objects and play a sound on each, then release() them.
I want to Play Multiple sounds. I know how to play them, but i want to play them synchronously. For example i have all my sounds of length 4 second. if i play first sound at 04:00:00 and second play on 04:00:02 then the second one start on 04:00:04 not in middle.
Is there any framework available in android to do this Or any other Help...