Moved all bindings to the "bindings" sub-directory
Renamed the CSFML directory to c Renamed the DSFML directory to d --> bindings must now be updated to match the new organization! git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1630 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
0cc5563cac
commit
0e2297af28
417 changed files with 0 additions and 0 deletions
|
@ -1,83 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SFML
|
||||
{
|
||||
namespace Audio
|
||||
{
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Specialized SoundRecorder which saves the captured
|
||||
/// audio data into a sound buffer
|
||||
/// </summary>
|
||||
////////////////////////////////////////////////////////////
|
||||
public class SoundBufferRecorder : SoundRecorder
|
||||
{
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Sound buffer containing the recorded data (invalid until the capture stops)
|
||||
/// </summary>
|
||||
////////////////////////////////////////////////////////////
|
||||
public SoundBuffer SoundBuffer
|
||||
{
|
||||
get
|
||||
{
|
||||
return mySoundBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Provide a string describing the object
|
||||
/// </summary>
|
||||
/// <returns>String description of the object</returns>
|
||||
////////////////////////////////////////////////////////////
|
||||
public override string ToString()
|
||||
{
|
||||
return "[SoundBufferRecorder]" +
|
||||
" SampleRate(" + SampleRate + ")" +
|
||||
" SoundBuffer(" + SoundBuffer + ")";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Called when a new capture starts
|
||||
/// </summary>
|
||||
/// <returns>False to abort recording audio data, true to continue</returns>
|
||||
////////////////////////////////////////////////////////////
|
||||
protected override bool OnStart()
|
||||
{
|
||||
mySamplesArray.Clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Process a new chunk of recorded samples
|
||||
/// </summary>
|
||||
/// <param name="samples">Array of samples to process</param>
|
||||
/// <returns>False to stop recording audio data, true to continue</returns>
|
||||
////////////////////////////////////////////////////////////
|
||||
protected override bool OnProcessSamples(short[] samples)
|
||||
{
|
||||
mySamplesArray.AddRange(samples);
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Called when the current capture stops
|
||||
/// </summary>
|
||||
////////////////////////////////////////////////////////////
|
||||
protected override void OnStop()
|
||||
{
|
||||
mySoundBuffer = new SoundBuffer(mySamplesArray.ToArray(), 1, SampleRate);
|
||||
}
|
||||
|
||||
List<short> mySamplesArray = new List<short>();
|
||||
SoundBuffer mySoundBuffer = null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue