You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2013/06/14 20:53:57 UTC
[3/5] wp7 commit: Missed a function there ... added it to Audio
Player and Recorder.
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/fe2026e3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp7/tree/fe2026e3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp7/diff/fe2026e3
Branch: refs/heads/master
Commit: fe2026e3a61cb0266fcdebfbdca4e2dfddf3719a
Parents: 12474d1
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Jun 11 14:41:23 2013 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Jun 11 14:41:23 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/fe2026e3/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/fe2026e3/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