Importing non audio files as raw data
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
-
rlaliberty
- Posts: 16
- Joined: Thu Sep 27, 2012 8:12 pm
- Operating System: Please select
Re: Importing non audio files as raw data
Wouldn't that mean the each channel was playing something different?
-
rlaliberty
- Posts: 16
- Joined: Thu Sep 27, 2012 8:12 pm
- Operating System: Please select
Re: Importing non audio files as raw data
Right. That was a stupid question. So is this more correct?
So, when we import NTOSKRNL.exe as a sound file into Audacity, we are interpreting the binary code that it contains as if we were interpreting any other audio file. For example, say we cull these two arbitrary bytes/16 bits from the file: 0101 0100 and 1101 1000 (Hex: 54 E8). The order of which these bytes are read depends on the endianness. If we chose “little endian” then the least-significant byte is read first. Thus, we would have “54E8,” or in decimal, 21,736. If our bit depth is 16, we have 65,536 possible amplitude levels of the sound. However, since we imported the file as 2 channel stereo, this number is halved: thus, we have 32,768. Based on the 16 bit PCM encoding, the amplitude of the given sample is then approximately 65,536/32,768 or + .66333. This process repeats based on the sample rate, in our case, 44,100 times a second, until the file is totally read and rendered as an analog wave. Since we imported the file as 2 channel stereo, PCM encoding dictates that the channels are interleaved, meaning that sample 1 goes to the left channel, sample 2 to the right, sample 3 to the left, and so on. Frequency/pitch is a product of wavelength/time, and if we know the amplitude at any given time, we also know the distance from one crest to another and thus the frequency of a given sample.
Re: Importing non audio files as raw data
No it is not halved. If the bit depth is 16 then there are 65,536 possible amplitude levels for each and every sample.rlaliberty wrote: If our bit depth is 16, we have 65,536 possible amplitude levels of the sound. However, since we imported the file as 2 channel stereo, this number is halved:
16 bit audio usually uses signed notation so there are 32,768 values below zero and 32,767 values above zero. (see: http://en.wikipedia.org/wiki/Two%27s_complement)
Yes. That's the whole point of stereo. http://en.wikipedia.org/wiki/Stereorlaliberty wrote:Wouldn't that mean the each channel was playing something different?
This article provides a lot of information: http://en.wikipedia.org/wiki/Audio_bit_depth
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
-
rlaliberty
- Posts: 16
- Joined: Thu Sep 27, 2012 8:12 pm
- Operating System: Please select
Re: Importing non audio files as raw data
You're a saint, Steve. I'd buy you a beer if I could. Thanks!
Re: Importing non audio files as raw data
We're probably several time zones apart, but next time you're having a beer, raise your glass... cheersrlaliberty wrote: I'd buy you a beer if I could.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
-
cloud_canvas
- Posts: 2
- Joined: Sat Feb 15, 2014 6:52 pm
- Operating System: Please select
Re: Importing non audio files as raw data
One more quick question about this to amend something to the current definition.
Is the header included in the rendering process as well? As in, the header is rendered as 16-bit samples at the beginning of the audio file as well?
Is the header included in the rendering process as well? As in, the header is rendered as 16-bit samples at the beginning of the audio file as well?
-
Gale Andrews
- Quality Assurance
- Posts: 41761
- Joined: Fri Jul 27, 2007 12:02 am
- Operating System: Windows 10
Re: Importing non audio files as raw data
Any header in an audio file is rendered and will be heard as an audible click.cloud_canvas wrote:Is the header included in the rendering process as well? As in, the header is rendered as 16-bit samples at the beginning of the audio file as well?
Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Re: Importing non audio files as raw data
So I just posted my first post and thought "Hey I'll read through the forum a little" and saw this one.
Then it dawned on me to have Audacity import the Audacity executable.
Its mostly noise as you'd expect, but there are some sections that work out to be "tonal"(?) I guess for lack of a better word.
I did...
File->Import->Raw Data
[select Audacity executable]
Select
"Signed 16 bit PCM"
"Little endian"
[leave others default]
Click "Import"
You can see some of the stuff I'm talking about starting around the 41 second mark.
Anyway... that was fun.
Then it dawned on me to have Audacity import the Audacity executable.
Its mostly noise as you'd expect, but there are some sections that work out to be "tonal"(?) I guess for lack of a better word.
I did...
File->Import->Raw Data
[select Audacity executable]
Select
"Signed 16 bit PCM"
"Little endian"
[leave others default]
Click "Import"
You can see some of the stuff I'm talking about starting around the 41 second mark.
Anyway... that was fun.