Initial
This commit is contained in:
12003
hex to wave/1.txt
Normal file
12003
hex to wave/1.txt
Normal file
File diff suppressed because it is too large
Load Diff
BIN
hex to wave/8bit-to-binary.vi
Normal file
BIN
hex to wave/8bit-to-binary.vi
Normal file
Binary file not shown.
BIN
hex to wave/Hex to Binary 64 bit (LV 8+).vi
Normal file
BIN
hex to wave/Hex to Binary 64 bit (LV 8+).vi
Normal file
Binary file not shown.
BIN
hex to wave/Hex to Byte Array.vi
Normal file
BIN
hex to wave/Hex to Byte Array.vi
Normal file
Binary file not shown.
BIN
hex to wave/Hex-to-Binary-Labview.vi
Normal file
BIN
hex to wave/Hex-to-Binary-Labview.vi
Normal file
Binary file not shown.
BIN
hex to wave/HexToBin.vi
Normal file
BIN
hex to wave/HexToBin.vi
Normal file
Binary file not shown.
BIN
hex to wave/HexToBooleanArray (1).vi
Normal file
BIN
hex to wave/HexToBooleanArray (1).vi
Normal file
Binary file not shown.
BIN
hex to wave/HexToBooleanArray.vi
Normal file
BIN
hex to wave/HexToBooleanArray.vi
Normal file
Binary file not shown.
BIN
hex to wave/New folder/__MACOSX/py/._1.txt
Normal file
BIN
hex to wave/New folder/__MACOSX/py/._1.txt
Normal file
Binary file not shown.
BIN
hex to wave/New folder/__MACOSX/py/._H28cTest.py
Normal file
BIN
hex to wave/New folder/__MACOSX/py/._H28cTest.py
Normal file
Binary file not shown.
BIN
hex to wave/New folder/py.zip
Normal file
BIN
hex to wave/New folder/py.zip
Normal file
Binary file not shown.
BIN
hex to wave/New folder/py/.DS_Store
vendored
Normal file
BIN
hex to wave/New folder/py/.DS_Store
vendored
Normal file
Binary file not shown.
12003
hex to wave/New folder/py/1.txt
Normal file
12003
hex to wave/New folder/py/1.txt
Normal file
File diff suppressed because it is too large
Load Diff
BIN
hex to wave/New folder/py/1.wav
Normal file
BIN
hex to wave/New folder/py/1.wav
Normal file
Binary file not shown.
60
hex to wave/New folder/py/H28cTest.py
Normal file
60
hex to wave/New folder/py/H28cTest.py
Normal file
@@ -0,0 +1,60 @@
|
||||
import serial
|
||||
import binascii as ba
|
||||
import wave
|
||||
import os
|
||||
import time
|
||||
from time import sleep
|
||||
#from command import testcommandodelist, commandresultlist
|
||||
import struct
|
||||
import soundfile as sf
|
||||
import numpy as np
|
||||
import sys
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def audio_dump_to_wav_3Mics_32bit(path,new_audio_path,wav_name):
|
||||
binData = bytearray()
|
||||
hexfile = open(path,encoding='utf-8')
|
||||
#print(hexfile)
|
||||
for textLine in hexfile.readlines():
|
||||
binFile = []
|
||||
#print(textLine)
|
||||
textLine = textLine.upper().strip()
|
||||
textline = textLine.encode('utf-8','ignore').decode('utf-8')
|
||||
if (textLine[0] != ':'):continue
|
||||
textLine = textLine[1:]
|
||||
#print(textLine)
|
||||
textLine = textLine.replace('0X', '').replace(',', '').replace(' ', '')
|
||||
binBytes = ba.unhexlify(textLine)
|
||||
#print(binBytes)
|
||||
if binFile: binFile.write(binBytes)
|
||||
binData += binBytes
|
||||
endianness = sys.byteorder
|
||||
crc32 = ba.crc32(binData) & 0xFFFFFFFF
|
||||
numBytes = len(binData)
|
||||
print('%d bytes, CRC32: 0x%08X' % (numBytes, crc32))
|
||||
print(' ')
|
||||
numSamples = numBytes // struct.calcsize('>f')
|
||||
dataFormat = ('<%df' % numSamples) if endianness == 'little' else ('>%df' % numSamples)
|
||||
audio = np.array(struct.unpack(dataFormat, binData))
|
||||
audio = audio.reshape(int(len(audio)/1),1)
|
||||
TOP_Data = audio[:,0]
|
||||
#Top_data = audio[:,0]
|
||||
#Error_data = audio[:,2]
|
||||
sf.write(new_audio_path + wav_name +'.wav',TOP_Data,48000,subtype='PCM_32')
|
||||
#sf.write(new_audio_path + wav_name +'_'+'32bit.wav',Top_data,48000,subtype='PCM_32')
|
||||
#sf.write(new_audio_path + wav_name +'_'+'Error_32bit.wav',Error_data,16000,subtype='PCM_32')
|
||||
print("audio dump to wav 黑化肥发灰 灰化肥发黑 !!!")
|
||||
|
||||
datapath = '/Users/h3637_h716454/Desktop/py/' # save here
|
||||
fpmic = datapath + '/'
|
||||
try:
|
||||
os.makedirs(fpmic)
|
||||
except OSError:
|
||||
print('File Exists')
|
||||
fp1 = fpmic + '1.txt'
|
||||
wav_name='1'
|
||||
audio_dump_to_wav_3Mics_32bit(fp1,fpmic,wav_name)
|
||||
|
||||
BIN
hex to wave/ShowBinary.vi
Normal file
BIN
hex to wave/ShowBinary.vi
Normal file
Binary file not shown.
12000
hex to wave/audio dump 0509.txt
Normal file
12000
hex to wave/audio dump 0509.txt
Normal file
File diff suppressed because it is too large
Load Diff
BIN
hex to wave/hex to wave.vi
Normal file
BIN
hex to wave/hex to wave.vi
Normal file
Binary file not shown.
BIN
hex to wave/main.vi
Normal file
BIN
hex to wave/main.vi
Normal file
Binary file not shown.
BIN
hex to wave/mic array file read and waveforms make.vi
Normal file
BIN
hex to wave/mic array file read and waveforms make.vi
Normal file
Binary file not shown.
BIN
hex to wave/output.bin
Normal file
BIN
hex to wave/output.bin
Normal file
Binary file not shown.
Reference in New Issue
Block a user