Wie konvertiert man ADPCM in WAV in Windows?

1639
chwi

Ich habe das folgende Rahmenformat meiner ADPCM-Daten

Das Rahmenformat des ADPCM ist

# byte | Contents ---------------------------------------------------------- 0 | Encoder state: LSByte of 1st PCM value in frame 1 | Encoder state: MSByte of 1st PCM value in frame 2 | Encoder state: ADPSM step table index 3 - 258 | ADPCM encoded 16 bit PCM values 

Wie kann ich dieses ADPCM-Signal in ein akustisches WAV-Format unter Windows 7 decodieren? Ich habe versucht , eine Lösung für Python zu finden, aber jetzt werde ich alles versuchen .

0

1 Antwort auf die Frage

0
chwi

Mit Python:

import wave import sys import audioop import binascii  # Get the fragments of ADPCM data: # Here, blocks is an array of 259byte data represented as strings which is parsed # from the ADPCM data file, write this according to the structure of your ADPCM file block = getAdpcmFragments(adpcm_file_path)  #Set parameters for the wavefile according to your audio stream wave_file = wave.open(wave_file_path, 'wb') wave_file.setparams((2,2,16000, 0, 'NONE', 'NONE'))  # Using ASCII to Binary from the binascii lib to convert strings represented as e.g # 4A, 6F etc into actual binary values. Then I am writing the linear PCM data from  # adpcm2lin to the wav-file.  state = None  for this in block: pcm, state = audioop.adpcm2lin(binascii.a2b_hex(this), 4, state) wave_file.writeframes(pcm) 
Was ist die Funktion - getAdpcmFragments (Dateiname)? Benutzerdefinierten? Satarupa Guha vor 7 Jahren 0