adpcm | Sound chip ADPCM codec library | Audio Utils library
kandi X-RAY | adpcm Summary
kandi X-RAY | adpcm Summary
Sound chip ADPCM codec library
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of adpcm
adpcm Key Features
adpcm Examples and Code Snippets
Community Discussions
Trending Discussions on adpcm
QUESTION
I am currently working on reading a RIff fmt .wav file using c++. How could I find the date and time the file was created. The only time included in the header is the TimeStamp
which represents Seconds since epoch.
The following are the parsed RIff headers I am using :
...ANSWER
Answered 2021-Nov-10 at 19:59The Timestamp
field in the WAV file metadata and the file creation date are to unrelated pieces of information.
The file creation date is the date the file was created on the hard drive. You can use the Windows API GetFileTime
to get the creation, last access and last write times.
The Timestamp
is just some information someone put inside the WAV file. It may or may not be present and may or may not be the same time/date information you will get with GetFileTime
.
QUESTION
I am trying to read correctly a WAVE file, PCM, mono, 16 bits (2 bytes per sample). I have managed to read the header. The problem is reading (writing) the data part.
As far as I understand the 16-bit samples in the data chunk are little-endian, and "split" into two chunks of 8 bits each. So for me a way to read the correct data should be:
- Read file and put chunks into two different
int8_t
variables (or astd::vector
..) - In some way "join" these two variables to make a
int16_t
and being able to process it.
The problem is I have no idea on how to deal with the little-endianness and the fact that these samples aren't unsigned, so I can't use the << operator.
This is one of the test I've done, without success:
...ANSWER
Answered 2021-May-15 at 19:52I'm a Java programmer, not C++, but I've dealt with this often.
The PCM data is organized by frame. If it's mono, little-endian, 16-bit the first byte will be the lower half of the value, and the second byte will be the upper and include the sign bit. Big-endian will reverse the bytes. If it's stereo, a full frame (I think it's left then right but I'm not sure) is presented intact before moving on to the next frame.
I'm kind of amazed at all the code being shown. In Java, the following suffices for PCM encoded as signed values:
QUESTION
There are telephone communication systems as follows.
Among these, I am going to develop a repeater. The repeater performs tcp/ip communication.
Receive adpcm data in bytes from user1 and user2, respectively.
I want to save the data received from the repeater as an audio file.
Once the data from one side (user1) was collected and made into a byte array, I created a wav file using Naudio, but it failed.
When I play it using the default playback app of window10, it plays for about 1 second and ends. However, the total playing time is longer, such as 6 seconds and 7 seconds.
The data below is a part from the beginning of the binary data of the wav file I created.
52 49 46 46 B4 65 00 00 57 41 56 45 66 6D 74 20 32 00 00 00 02 00 01 00 40 1F 00 00 00 10 00 00 00 01 04 00 20 00 F4 01 07 00 00 01 00 00 00 02 00 FF 00 00 00 00 C0 00 40 00 F0 00 00 00 CC 01 30 FF 88 01 18 FF 66 61 63 74 04 00 00 00 C4 CA 00 00 64 61 74 61 62 65 00 00 77 77 77 68 08 08 08 08 08 08 08 08 08 08 80 08 08 9A 99 99 90 01 21 21 12 25 53 40 9A B9 91 24 34 11 8A BC AA 80 13 17 43 42 12 09 8A AB DB BB BA 9A 88 12 02 A0 BA BB DB A9 8A 01 33 33 31 10 1A 0B BB BA A0 91 22 32 11 90 A9 BB BB 9B 11 23 33 41 11 19 9B AB B9 11 22 13 35 11 08 99 AA BC A1 A1 00 31 31 11 A9 0A AB BB 9A 10 13 14 12 91 90 9B 9B B9 A0 11 13 41 29 29 09 9B AB B9 09 10 13 33 11 A9 BB BB CA 09 00 12 33 33 39 39 1A AA B9 B1 91 22 33 40 01 90 A9 BC A9 99 01 31 41 01 9A 9B 9C 9A 9A 90 01 33 33 21 01 09 9B A9 90 11 11 33 33 21 01 0A 9B 9A 99 01 03 14 10 19 99 B9 BB BA B0 90 12 33 11 20 91 A9 99 9A 01 02 11 33 01 10 09 99 B0 A0 10 12 13 31 29 99 9B 9A B0 99 90 01 11 21 90 91 09 19 09 10 90 12 03 19 19 19 09 99 19 99 00 11 13 10 90 99 BA B9 B0 99 00 01 91 00 99 11 99 00 11 01 11 11 11 19 99 11 91 91 11 00 10 01 20 01 90 99 AA 9A 99 01 91 99 9A 9A 99 19 01 10 11 11 21 11 3A 09 99 90 00 31 11 19 10 91 91 11 01 9A
Here is the code I implemented(audiodata is byte array of adpcmdata):
...ANSWER
Answered 2021-Jan-15 at 06:00The headers of the file (from your data block above) look fine for 8kHz Mono ADPCM. All of these are written by NAudio so I expect them to match the code. This particular file has 51,908 total samples (~6.5 seconds), which matches with the 25,954 bytes worth of data in the data chunk. So far, so good... if the data is in the Microsoft ADPCM format.
Unfortunately there are numerous ADPCM formats with subtle differences, whether in the coefficients used by the codec, the number of bits per sample (anywhere from 2 to 6, although 4 is most common), supported sample rates and block encoding. G723 used to be common in telephony but you'll find all sorts.
Apart from differences in supported features (bits per sample, channel counts, sample frequency, etc) different formats use different block structures. IMA/DVI ADPCM produce blocks of samples with a 4-byte header to correct drift and get the decoder state back in sync.
If I had to guess though I'd go with something like the Dialogic/OKI ADPCM format.
QUESTION
I have a file with no header with IMA ADPCM raw data stored, I would like to play it using NAudio. In Audacity, using this config plays without problems:
...ANSWER
Answered 2021-Jan-09 at 17:51You can't usually play compressed formats directly. Pass the RawSourceWaveStream
into WaveFormatConversionStream.CreatePcmStream
to get to PCM. That should work if you have the right codec available on your PC and if you've correctly specified the source WaveFormat
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install adpcm
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page