Missed a function there ... added it to Audio Player and Recorder.
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp7/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp7/commit/2c477f43 Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp7/tree/2c477f43 Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp7/diff/2c477f43 Branch: refs/heads/master Commit: 2c477f436174e24f8b4e3e57b88e4bc84a5da957 Parents: 2eb31bb Author: Jesse MacFadyen <[email protected]> Authored: Tue Jun 11 14:41:23 2013 -0700 Committer: Benn Mapes <[email protected]> Committed: Wed Jun 12 15:16:55 2013 -0700 ---------------------------------------------------------------------- templates/standalone/Plugins/AudioPlayer.cs | 9 +++++++-- templates/standalone/Plugins/UI/AudioRecorder.xaml.cs | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/2c477f43/templates/standalone/Plugins/AudioPlayer.cs ---------------------------------------------------------------------- diff --git a/templates/standalone/Plugins/AudioPlayer.cs b/templates/standalone/Plugins/AudioPlayer.cs index 6c94016..fe85e6b 100644 --- a/templates/standalone/Plugins/AudioPlayer.cs +++ b/templates/standalone/Plugins/AudioPlayer.cs @@ -579,12 +579,17 @@ namespace WPCordovaClassLib.Cordova.Commands /// <returns></returns> private void SaveAudioClipToLocalStorage() { - if (this.memoryStream == null || this.memoryStream.Length <= 0) + if (memoryStream == null || memoryStream.Length <= 0) { return; } - this.memoryStream.UpdateWavStream(); + long position = memoryStream.Position; + memoryStream.Seek(4, SeekOrigin.Begin); + memoryStream.Write(BitConverter.GetBytes((int)memoryStream.Length - 8), 0, 4); + memoryStream.Seek(40, SeekOrigin.Begin); + memoryStream.Write(BitConverter.GetBytes((int)memoryStream.Length - 44), 0, 4); + memoryStream.Seek(position, SeekOrigin.Begin); try { http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/2c477f43/templates/standalone/Plugins/UI/AudioRecorder.xaml.cs ---------------------------------------------------------------------- diff --git a/templates/standalone/Plugins/UI/AudioRecorder.xaml.cs b/templates/standalone/Plugins/UI/AudioRecorder.xaml.cs index 74fb846..6ff0b5c 100644 --- a/templates/standalone/Plugins/UI/AudioRecorder.xaml.cs +++ b/templates/standalone/Plugins/UI/AudioRecorder.xaml.cs @@ -251,7 +251,13 @@ namespace WPCordovaClassLib.Cordova.UI return new AudioResult(TaskResult.Cancel); } - this.memoryStream.UpdateWavStream(); + //this.memoryStream.UpdateWavStream(); + long position = memoryStream.Position; + memoryStream.Seek(4, SeekOrigin.Begin); + memoryStream.Write(BitConverter.GetBytes((int)memoryStream.Length - 8), 0, 4); + memoryStream.Seek(40, SeekOrigin.Begin); + memoryStream.Write(BitConverter.GetBytes((int)memoryStream.Length - 44), 0, 4); + memoryStream.Seek(position, SeekOrigin.Begin); // save audio data to local isolated storage
