Note that there are some explanatory texts on larger screens.

plurals
  1. PONAudio MediaFoundationRecorder EncodeToAAC Byte array instead of file
    primarykey
    data
    text
    <p>What I'm currently doing is while recording I get the bytes from the data received event and encode the bytes with a codec. The codecs I have set up to currently use are ALaw, G722, GSM, etc (like in the <a href="http://naudio.codeplex.com/SourceControl/latest#NAudioDemo/NetworkChatDemo/INetworkChatCodec.cs" rel="nofollow">NetworkChatDemo</a>)</p> <p>The code used to start recording</p> <pre><code> If waveIn Is Nothing Then waveIn = New WaveIn waveIn.DeviceNumber = 0 waveIn.BufferMilliseconds = 100 waveIn.WaveFormat = codec.RecordFormat waveIn.StartRecording() End If </code></pre> <p>The code used to work with the recorded bytes</p> <pre><code>Private Sub OnDataAvailable(ByVal sender As Object, ByVal e As WaveInEventArgs) Handles waveIn.DataAvailable Dim encoded As Byte() = codec.Encode(e.Buffer, 0, e.BytesRecorded) ... //Send encoded audio over UdpClient End Sub </code></pre> <p>This is working well for me but I'd like to add support for the AAC format. So I'd like to achieve the same result as in the above DataReceived event, a byte array of encoded AAC audio which I can send over udp, from <code>MediaFoundationEncoder.EncodeToAac(...)</code> or another class/function I am not aware of within NAudio. As far as I can tell, <code>MediaFoundationEncoder.EncodeToAac(...)</code> only encodes audio to a file and not a byte array. It also doesn't accept a byte array as a parameter. Is there a way to achieve what I want or does NAudio only let me work with an AAC file after it has been fully recorded and saved?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload