0

If I have an audio *WAV file or record and I want to extract this information from this audio by C# How I can do it? I want an easy way please Information I wanted to extract it

  • Number of Samples
  • Duration in seconds
  • Sampling rate in Hertz
  • Channels (Mono/Stereo)
  • PCM
  • Bit (8/16/24/32/64)
3
  • 2
    Does this answer your question? Accessing audio/video metadata with .NET Commented Aug 30, 2020 at 19:41
  • There are many types of audio files, e.g. WAV, MP3, AAC etc. You probably need to be more specific about the file you are trying to decode. Have you googled 'xxx file format' where 'xxx' is the file extension you have? Commented Aug 30, 2020 at 21:12
  • the type of files which I need to extract is WAV Commented Aug 30, 2020 at 21:25

1 Answer 1

0

Here is the specification of the wav format header:

  • Sampling rate in Hertz: bytes 25-28 of header
  • Channels (Mono/Stereo): bytes 23/24 of header
  • PCM: bytes 21-22 of header
  • Bit depth (8/16/24/32/64): bytes 35-36 of header
  • Number of Samples and Duration in seconds: you can deduce it from other data in header.

To inspect this data, you could read the file as a binary stream and then interpret the stream accordingly. This question should guide you.

Sign up to request clarification or add additional context in comments.

2 Comments

can you tell me how or what's the equation?
@AbdullahAl-Sharif I pointed you to a question which should help you out.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.