Exemplo n.º 1
0
 public int BytesToSamples(AudioFormat format, int bytes)
 {
     return(bytes / (format.Size >> 3));
 }
Exemplo n.º 2
0
 public int SamplesToBytes(AudioFormat format, int samples)
 {
     return(samples * (format.Size >> 3));
 }
Exemplo n.º 3
0
 public int BytesToFrames(AudioFormat format, int bytes)
 {
     return(bytes / (format.Components.Length * format.Size >> 3));
 }
Exemplo n.º 4
0
 public int FramesToBytes(AudioFormat format, int samples)
 {
     return(samples * (format.Components.Length * format.Size >> 3));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Constructs a new AudioFormat which is a derivative of the given AudioFormat with a different byte order.
 /// </summary>
 /// <param name="format">The existing AudioFormat</param>
 /// <param name="newByteOrder">The new byte order</param>
 public AudioFormat(AudioFormat format, Common.Binary.ByteOrder newByteOrder)
     : this(format.SampleRate, format.IsSigned, format.ByteOrder, format.DataLayout)
 {
 }
Exemplo n.º 6
0
 public static int CalculateFrameSize(AudioFormat format)
 {
     return(format.Size >> 3 * format.Components.Length);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Constructs a new AudioFormat which is a derivative of the given AudioFormat with a different sample rate.
 /// </summary>
 /// <param name="format">The existing AudioFormat</param>
 /// <param name="newSampleRate">The new sampleRate</param>
 public AudioFormat(AudioFormat format, int newSampleRate)
     : this(newSampleRate, format.IsSigned, format.ByteOrder, format.DataLayout)
 {
 }
Exemplo n.º 8
0
 /// <summary>
 /// Clones an AudioFormat
 /// </summary>
 /// <param name="format">The AudioFormat to clone</param>
 internal protected AudioFormat(AudioFormat format)
     : this(format.SampleRate, format.IsSigned, format.ByteOrder, format.DataLayout)
 {
 }
Exemplo n.º 9
0
 public static AudioFormat SemiPlanar(AudioFormat other)
 {
     return(new AudioFormat(Codec.MediaFormat.SemiPlanar(other)));
     //return new ImageFormat(other.ByteOrder, Codec.DataLayout.SemiPlanar, other.Components);
 }
Exemplo n.º 10
0
 public static AudioFormat Planar(AudioFormat other)
 {
     return(new AudioFormat(Codec.MediaFormat.Planar(other)));
 }
Exemplo n.º 11
0
 public static AudioFormat Packed(AudioFormat other)
 {
     return(new AudioFormat(Codec.MediaFormat.Packed(other)));
 }