Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I am spec'ng out an app that needs to play multiple audio tracks simultaneously. I ran across this Q&A in the FAQ, but have not seen anything about it in the forums.
--------
Is it possible to play more than one tone simultaneously?

In BREW version 2.0, the IMEDIA interface can be used to play multiple QCP files (maximum 4) simultaneously on CMX 2.x based devices. In addition to this 1 MIDI file can also be played along with the 4 QCP files allowing a total of (4QCP + 1MIDI) 5 different files to play simultaneously. To do this create 4 IMedia objects for MIDIOutQCP by calling
ISHELL_CreateInstance(….,AEECLSID_MEDIAMIDIOUTQCP). Initialize each of these objects with their respective data by calling IMEDIA_SetMediaData and play them using IMEDIA_Play().

Simultaneous tones and files cannot be played in BREW versions 1.0 and 1.1. If a call is made to play the second tone before the first tone is finished playing, the first tone will be aborted.
https://brewx.qualcomm.com/bws/content/gi/common/appseng/en/developerfaqs/docs/media/sound/soundm.html
-----

Is this on the level? Has anyone had success with this? Does anyone know of any issues? Any insight at all would be great.
Thanks so much

i just tried to play two sounds (on the VX8000) just as described in the FAQ, and it did not work. the second sound was never heard.
it appears, even though you can create multiple IMEDIA interfaces, you cannot use them simultaneously.
please someone correct me if i am wrong.

i just tried to play two sounds (on the VX8000) just as described in the FAQ, and it did not work. the second sound was never heard.
it appears, even though you can create multiple IMEDIA interfaces, you cannot use them simultaneously.
please someone correct me if i am wrong.

can you say "jump to conclusions"? nevermind, it works fine .

can you say "jump to conclusions"? nevermind, it works fine .

I have tried the above and can't get it to work. It will play in the emulator, but on the phone the AEECLSID_MEDIAMIDIOUTQCP loads fine and does not play sound. Has anyone got this to work on the lg vx8000 or any other phone, I have the same behavior on the A890 and 8940.
If so, could you possible post up some working code? I have tried using the ChannelShare function, loading using IMediaUtil, and several other ways of loading sound, all with the same result.
Thanks

I have tried the above and can't get it to work. It will play in the emulator, but on the phone the AEECLSID_MEDIAMIDIOUTQCP loads fine and does not play sound. Has anyone got this to work on the lg vx8000 or any other phone, I have the same behavior on the A890 and 8940.
If so, could you possible post up some working code? I have tried using the ChannelShare function, loading using IMediaUtil, and several other ways of loading sound, all with the same result.
Thanks

I tried the above in a variety of ways for loading the sounds and playing the sounds and nothing works. Sample code would be very helpful, even if it is pseudocode.
I have a long midi I start playing and then qcp sound effects that I want to play on top of the background midi. Also, is there a way to check the cmx version on the device, I am using a vx8000 with brew 2.1.3.8. Thanks

I tried the above in a variety of ways for loading the sounds and playing the sounds and nothing works. Sample code would be very helpful, even if it is pseudocode.
I have a long midi I start playing and then qcp sound effects that I want to play on top of the background midi. Also, is there a way to check the cmx version on the device, I am using a vx8000 with brew 2.1.3.8. Thanks

8octopus8 wrote:can you say "jump to conclusions"? nevermind, it works fine .
So how did you get it to work? I'm still trying to make this multiple sounds thing work. I've read everything I could find in the forums and looked at the documentation. It seems no one really gives a comprehensive explanation from start to finish on how to do this.
Where is what I am doing...(some pseudocode)
This is BREW SDK 2.1.x
I have my own wrapper class...The first method of importants is LoadMedia
int Media::LoadSound(Stream* pStream) {
int ret;
m_Data.clsData = MMD_BUFFER;
m_Data.dwSize = pStream->Length();
m_Data.pData = new byte [m_Data.dwSize];
ret = pStream->Read(m_Data.pData, m_Data.dwSize);
// Ok, we have media util, lets create media object.
if (ISHELL_CreateInstance(m_pIShell, AEECLSID_MEDIAMIDIOUTQCP, (void**)&m_pIMedia) != SUCCESS) {
return FAILED;
}
IMEDIA_SetMediaParm(m_pIMedia, MM_PARM_CHANNEL_SHARE, TRUE,0);
IMEDIA_SetMediaData(m_pIMedia, &m_Data);
return SUCCESS;

Now, here is the play method
int32 Media::Play(uint32 loop) {
return IMEDIA_Play(m_pIMedia);

Now the implementation
The first sound plays, the second sound does not.
Filestream fs1("title.mid");
Filestream fs2("engine.qcp");
m_pMedia1->LoadSound(&fs1);
m_pMedia2->LoadSound(&fs2);
int i = m_pMedia->Play(); // SUCCESS!!
i = m_pMedia2->Play(); // FAILURE. Error Code 2703
Interesting thing is this....
When I trace into the LoadSound method, something bizarre happens.
With the first sound, everything works ok. With the second sound, I get something weird when I call
IMEDIA_SetMediaParm(m_pIMedia, MM_PARM_CHANNEL_SHARE, TRUE,0);
Suddenly, all the entire m_pIMedia object goes corrupt. from the previous call on the second sound (QCP file).
When I reverse the order of loading, the QCP sound plays correctly, but the same problems occur with the MIDI file.
I've tried variations of the LoadSound code, also using the AEEMediaUtil. and looks something like this
int Media::LoadSound(Stream* pStream) {
int ret;
m_Data.clsData = MMD_BUFFER;
m_Data.dwSize = pStream->Length();
m_Data.pData = new byte [m_Data.dwSize];
ret = pStream->Read(m_Data.pData, m_Data.dwSize);
// Ok, we have media util, lets create media object.
if (AEEMediaUtil_CreateMedia(m_pIShell, &m_Data, &m_pIMedia) != SUCCESS) {
return FAILED;
}
IMEDIA_SetMediaParm(m_pIMedia, MM_PARM_CHANNEL_SHARE, TRUE,0);
return SUCCESS;

I get the same results from both versions of LoadSound.
I've seen posted the same qualcomm docs for playing multiple sounds, and have done what those docs say, and it never works. I feel like there are some steps missing, or the docs make assumptions about what may have already been done or setup in order for this to happen. I am looking for more comprehensive explanation of how to do this.

8octopus8 wrote:can you say "jump to conclusions"? nevermind, it works fine .
So how did you get it to work? I'm still trying to make this multiple sounds thing work. I've read everything I could find in the forums and looked at the documentation. It seems no one really gives a comprehensive explanation from start to finish on how to do this.
Where is what I am doing...(some pseudocode)
This is BREW SDK 2.1.x
I have my own wrapper class...The first method of importants is LoadMedia
int Media::LoadSound(Stream* pStream) {
int ret;
m_Data.clsData = MMD_BUFFER;
m_Data.dwSize = pStream->Length();
m_Data.pData = new byte [m_Data.dwSize];
ret = pStream->Read(m_Data.pData, m_Data.dwSize);
// Ok, we have media util, lets create media object.
if (ISHELL_CreateInstance(m_pIShell, AEECLSID_MEDIAMIDIOUTQCP, (void**)&m_pIMedia) != SUCCESS) {
return FAILED;
}
IMEDIA_SetMediaParm(m_pIMedia, MM_PARM_CHANNEL_SHARE, TRUE,0);
IMEDIA_SetMediaData(m_pIMedia, &m_Data);
return SUCCESS;

Now, here is the play method
int32 Media::Play(uint32 loop) {
return IMEDIA_Play(m_pIMedia);

Now the implementation
The first sound plays, the second sound does not.
Filestream fs1("title.mid");
Filestream fs2("engine.qcp");
m_pMedia1->LoadSound(&fs1);
m_pMedia2->LoadSound(&fs2);
int i = m_pMedia->Play(); // SUCCESS!!
i = m_pMedia2->Play(); // FAILURE. Error Code 2703
Interesting thing is this....
When I trace into the LoadSound method, something bizarre happens.
With the first sound, everything works ok. With the second sound, I get something weird when I call
IMEDIA_SetMediaParm(m_pIMedia, MM_PARM_CHANNEL_SHARE, TRUE,0);
Suddenly, all the entire m_pIMedia object goes corrupt. from the previous call on the second sound (QCP file).
When I reverse the order of loading, the QCP sound plays correctly, but the same problems occur with the MIDI file.
I've tried variations of the LoadSound code, also using the AEEMediaUtil. and looks something like this
int Media::LoadSound(Stream* pStream) {
int ret;
m_Data.clsData = MMD_BUFFER;
m_Data.dwSize = pStream->Length();
m_Data.pData = new byte [m_Data.dwSize];
ret = pStream->Read(m_Data.pData, m_Data.dwSize);
// Ok, we have media util, lets create media object.
if (AEEMediaUtil_CreateMedia(m_pIShell, &m_Data, &m_pIMedia) != SUCCESS) {
return FAILED;
}
IMEDIA_SetMediaParm(m_pIMedia, MM_PARM_CHANNEL_SHARE, TRUE,0);
return SUCCESS;

I get the same results from both versions of LoadSound.
I've seen posted the same qualcomm docs for playing multiple sounds, and have done what those docs say, and it never works. I feel like there are some steps missing, or the docs make assumptions about what may have already been done or setup in order for this to happen. I am looking for more comprehensive explanation of how to do this.