Bug 6671 - AudioUnit.Stop() does not work
Summary: AudioUnit.Stop() does not work
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 5.3.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-08-23 21:40 UTC by adam.lickel
Modified: 2012-09-05 13:30 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description adam.lickel 2012-08-23 21:40:39 UTC
Tested with https://github.com/migueldeicaza/MonoTouch.AudioUnit/blob/master/MonoTouch_AudioUnit_PlayingSoundMemoryBased/ExtAudioBufferPlayer.cs

Ran with Alpha channel.
There was a minor change needed to get this to compile.
Comment 1 Sebastien Pouliot 2012-09-05 09:37:03 UTC
Using the latest alpha (did not try earlier versions) and the following patch (to compile) I have no issue with Stop (or Play) trying the Monotouch_AudioUnit_PlayingSoundMemoryBased.sln on both the iOS simulator and on devices (tried on iPad3).

Can you confirm or elaborate on how to reproduce the issue ?

diff --git a/MonoTouch_AudioUnit_PlayingSoundMemoryBased/ExtAudioBufferPlayer.cs b/MonoTouch_AudioUnit_PlayingSoundMemoryBased/ExtAudioBufferPlayer.cs
index 8a23fc6..89d83e7 100755
--- a/MonoTouch_AudioUnit_PlayingSoundMemoryBased/ExtAudioBufferPlayer.cs
+++ b/MonoTouch_AudioUnit_PlayingSoundMemoryBased/ExtAudioBufferPlayer.cs
@@ -159,7 +159,7 @@ namespace Monotouch_AudioUnit_PlayingSoundMemoryBased
             _audioComponent = AudioComponent.FindComponent(AudioTypeOutput.Remote);
             // creating an audio unit instance
-            _audioUnit = AudioUnit.CreateInstance(_audioComponent);
+            _audioUnit = new AudioUnit (_audioComponent);
             // setting audio format
Comment 2 adam.lickel 2012-09-05 13:20:44 UTC
Seems to be fixed now.
That was the only thing I changed as well.

For what it's worth the audio also looped when Stop() wasn't working.
Comment 3 Sebastien Pouliot 2012-09-05 13:30:42 UTC
From a quick look at the repository history I do not see a recent change that could have caused this. 

Please re-open if this occurs (randomly?) again and make sure to paste all the product versions used (you can get them from MD about dialog) and the version of iOS used (simulator and/or devices).