I'm using Playwavefile(AsoundFile, true) in the C# SDK.
This plays my sound file looping which is what I want it to do.
But...
How would I stop it playing????
We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020
I'm using Playwavefile(AsoundFile, true) in the C# SDK.
This plays my sound file looping which is what I want it to do.
But...
How would I stop it playing????
https://github.com/TeamSpeak-Systems...ection.cs#L991
WaveHandle Pause / Close
Thanks thorwe,
But I'm still struggling.
I'm doing something similar to the below, which starts the wave file but doesn't Pause it.
Calling noise.Close(); kills my app.
Code:public void Connection_TalkStatusChanged(Client client, TalkStatus status, bool isReceivedWhisper) { WaveHandle noise = Connection.PlayWaveFile(staticsound, true); if (status == TalkStatus.Talking) { noise.Paused = False; } else { noise.Paused = True; } }
You don't wanna create new handles on each talk status change.
You'll want to create it once and use that throughout.
Code:... WaveHandle m_NoiseHandleAsClassMember = null; ... public void Connection_TalkStatusChanged(Client client, TalkStatus status, bool isReceivedWhisper) { if (m_NoiseHandleAsClassMember == null) m_NoiseHandleAsClassMember = Connection.PlayWaveFile(staticsound, true); if (status == TalkStatus.Talking) { m_NoiseHandleAsClassMember.Paused = False; } else { m_NoiseHandleAsClassMember.Paused = True; } }
Thank you thorwe.
I couldn't get m_NoiseHandleAsClassMember.Paused = True; working correctly with my code, but with your help I could now use Close.
So the below did the trick.
Thanks again,Code:... WaveHandle m_NoiseHandleAsClassMember = null; ... public void Connection_TalkStatusChanged(Client client, TalkStatus status, bool isReceivedWhisper) { if (status == TalkStatus.Talking) { m_NoiseHandleAsClassMember = Connection.PlayWaveFile(staticsound, true); } else { if (m_NoiseHandleAsClassMember != null) { m_NoiseHandleAsClassMember.Close(); } } }
Merry Christmas.
There are currently 1 users browsing this thread. (0 members and 1 guests)