
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Reading WAV files with PCM/PCMA/PCMU compression or without compression.
There are two classes WavRead and WavWrite which will perform reading and writing of wave files respectively. Currenlty PCM, PCMU and PCMA formats are supported. You will get the raw data from the RTP stream which you can write into the wave file by providing information about the audio format, number of channels, sample rate etc.
::
wave_read = pywav.WavRead("<filename to read>")
# print parameters like number of channels, sample rate, bits per sample, audio format etc
# Audio format 1 = PCM (without compression)
# Audio format 6 = PCMA (with A-law compression)
# Audio format 7 = PCMU (with mu-law compression)
print(wave_read.getparams())
::
# first parameter is the file name to write the wave data
# second parameter is the number of channels, the value can be 1 (mono) or 2 (stereo)
# third parameter is the sample rate, 8000 samples per second
# fourth paramaer is the bits per sample, 8 bits per sample
# fifth parameter is the audio format, 1 means PCM with no compression.
wave_write = pywav.WavWrite("<filename to write>", 1, 8000, 8, 1)
# raw_data is the byte array. Write can be done only once for now.
# Incremental write will be implemented later
wave_write.write(<raw data>)
# close the file stream and save the file
wave_write.close()
FAQs
Read and write wav files with PCMA/PCMU compression
We found that pywav demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.