Answered
0
0

Hello, I wanted to ask a question regarding a problem that came up while using the fmod in the android studio.

First, playing music with the fmod in the Activity and using other apps at the same time can be done just like in the Service. Could you explain how this can happen?

Second, I would like the next music to play automatically after the previous one, so is there a method that can point the ending of the music?

  • You must to post comments
Good Answer
0
0

If you want to play audio in a background you have to use a service.

If you’re using studio you can find out when an instance has stopped playing using EventInstance::getPlaybackState, or by adding a callback with EventInstance::setCallback and waiting for FMOD_STUDIO_EVENT_CALLBACK_STOPPED. If you’re using the lowlevel you can query Channel::isPlaying() or use a callback passed the Channel::setCallback and wait for FMOD_CHANNELCONTROL_CALLBACK_END.

  • yoon sung joon

    Thanks for your reply. i understood second question’s reply. but in first quetion, i already knew that i have to use a service to play audio in a background. but when i play audio using activity, audio was also played in a background just like in the service. so i wondered how this can happen.

  • You must to post comments
Good Answer
0
0

Audio will play in the background regardless of service vs activity.

For this reason we have System::mixerSuspend and System::mixerResume to stop this from happening. So if you want to play music in the background, simply don’t call suspend.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.