[RESOLVED] PDK Sound Service Instance -> Play() Function
-
- Lockheed Martin
- Posts: 1207
- Joined: Tue Sep 25, 2012 2:34 pm
Re: PDK Sound Service Instance -> Play() Function
Hi Jim,
Storing the reference counted pointer in your own class should be fine. If your class is the sole owner of the ISoundInstance, you'll just want to make sure it has a ref-count of one throughout its lifetime so that is properly released when your class is destroyed.
Storing the reference counted pointer in your own class should be fine. If your class is the sole owner of the ISoundInstance, you'll just want to make sure it has a ref-count of one throughout its lifetime so that is properly released when your class is destroyed.
Clifton Crane
Prepar3D® Software Engineer Sr.
Prepar3D® Software Engineer Sr.
Re: PDK Sound Service Instance -> Play() Function
Hi guys,
now, I am seeing the following problem: I am trying to play a 3D sound just once, when a certain condition is met. The sound is created as CreateSoundInstance(bLooping = false) and all HRESULTS return S_OK. I checked with the debugger that Play() is indeed called only once in my code on the sound instance, but the sound loops audible, anyways. This is while IsLooping() on the SoundInstance returns false.
Is anyone able to confirm this behaviour or has an idea where I might be making a mistake?
All the best,
Benny
now, I am seeing the following problem: I am trying to play a 3D sound just once, when a certain condition is met. The sound is created as CreateSoundInstance(bLooping = false) and all HRESULTS return S_OK. I checked with the debugger that Play() is indeed called only once in my code on the sound instance, but the sound loops audible, anyways. This is while IsLooping() on the SoundInstance returns false.
Is anyone able to confirm this behaviour or has an idea where I might be making a mistake?
All the best,
Benny
-
- Lockheed Martin
- Posts: 1207
- Joined: Tue Sep 25, 2012 2:34 pm
Re: PDK Sound Service Instance -> Play() Function
Hi Benny,
Do you see the same behavior if the sound is not created as 3D?
Do you see the same behavior if the sound is not created as 3D?
Clifton Crane
Prepar3D® Software Engineer Sr.
Prepar3D® Software Engineer Sr.
Re: PDK Sound Service Instance -> Play() Function
Hi Clifton,Clifton Crane wrote: ↑Tue Dec 18, 2018 5:01 pm Hi Benny,
Do you see the same behavior if the sound is not created as 3D?
indeed, changing b3D to 'false' it is only played once. So it seems to have something to do with the 3D mode. What might this be?
Greets,
Benny
-
- Lockheed Martin
- Posts: 1207
- Joined: Tue Sep 25, 2012 2:34 pm
Re: PDK Sound Service Instance -> Play() Function
Hello,
What SOUND_GROUP are you using? Its possible that 3D sound may not work for SOUND_GROUP_VOICE.
What SOUND_GROUP are you using? Its possible that 3D sound may not work for SOUND_GROUP_VOICE.
Clifton Crane
Prepar3D® Software Engineer Sr.
Prepar3D® Software Engineer Sr.
-
- Posts: 37
- Joined: Thu Jul 20, 2017 7:15 pm
Re: PDK Sound Service Instance -> Play() Function
Clifton,
Thanks got it.
V/R
Jim
Thanks got it.
V/R
Jim
Re: PDK Sound Service Instance -> Play() Function
Clifton,
no, I am using SOUND_GROUP::SOUND_GROUP_ENVIRONMENT. I'm gonna wrap up some code without error checking and mabye you can spot a mistake:
with this->name being a wstring with an absolute path to a .wav file
with position being a valid world coordinate P3DDXYZ
Thanks in advance.
All the best, Benny
no, I am using SOUND_GROUP::SOUND_GROUP_ENVIRONMENT. I'm gonna wrap up some code without error checking and mabye you can spot a mistake:
Code: Select all
CComPtr<P3D::ISoundInstanceV440> soundInstance = nullptr;
Code: Select all
PDKSoundService->CreateSoundInstance(this->name.c_str(), SOUND_GROUP::SOUND_GROUP_ENVIRONMENT, VIEW_POINT::VIEW_POINT_ALL, false, true, true, (void**)&soundInstance);
Code: Select all
soundInstance->SetMinVolume(0.0);
Code: Select all
soundInstance->SetMaxVolume(10000.0);
Code: Select all
soundInstance->SetPitch(1.0f);
Code: Select all
soundInstance->SetPosition(position)
Code: Select all
soundInstance->SetCockpitAttenuation(0.0);
Code: Select all
soundInstance->SetFullScaleDistance(100.0f);
Code: Select all
soundInstance->Play();
All the best, Benny
-
- Lockheed Martin
- Posts: 1207
- Joined: Tue Sep 25, 2012 2:34 pm
Re: PDK Sound Service Instance -> Play() Function
Hello,
We were able to reproduce the issue where 3D one-shot sounds would continue to loop. This will be resolved in the next release. Return type will be corrected as well (i.e. IsPlaying() will return S_FALSE without having to call Play() first).
Thanks!
We were able to reproduce the issue where 3D one-shot sounds would continue to loop. This will be resolved in the next release. Return type will be corrected as well (i.e. IsPlaying() will return S_FALSE without having to call Play() first).
Thanks!
Clifton Crane
Prepar3D® Software Engineer Sr.
Prepar3D® Software Engineer Sr.
Re: PDK Sound Service Instance -> Play() Function
Thanks for the information, Clifton.
Nice to know I can stop trying to figure this one out.
All the best,
Benny
Nice to know I can stop trying to figure this one out.
All the best,
Benny
Re: PDK Sound Service Instance -> Play() Function
Hi guys,
it is now working on my side with 4.5. Thanks for the fix.
All the best,
Benny
it is now working on my side with 4.5. Thanks for the fix.
All the best,
Benny