Importing non audio files as raw data

Audio software developers forum.
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
rlaliberty
Posts: 16
Joined: Thu Sep 27, 2012 8:12 pm
Operating System: Please select

Re: Importing non audio files as raw data

Post by rlaliberty » Thu Oct 25, 2012 2:11 am

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

Post by rlaliberty » Thu Oct 25, 2012 2:21 am

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.

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Importing non audio files as raw data

Post by steve » Thu Oct 25, 2012 2:56 am

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:
No it is not halved. If the bit depth is 16 then there are 65,536 possible amplitude levels for each and every sample.
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)
rlaliberty wrote:Wouldn't that mean the each channel was playing something different?
Yes. That's the whole point of stereo. http://en.wikipedia.org/wiki/Stereo

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

Post by rlaliberty » Fri Oct 26, 2012 12:37 am

You're a saint, Steve. I'd buy you a beer if I could. Thanks!

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Importing non audio files as raw data

Post by steve » Fri Oct 26, 2012 1:49 am

rlaliberty wrote: I'd buy you a beer if I could.
We're probably several time zones apart, but next time you're having a beer, raise your glass... cheers ;)
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

Post by cloud_canvas » Sat Feb 15, 2014 7:01 pm

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?

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

Post by Gale Andrews » Sun Feb 16, 2014 3:20 pm

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?
Any header in an audio file is rendered and will be heard as an audible click.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

ggreene
Posts: 4
Joined: Fri Mar 07, 2014 1:19 am
Operating System: Please select

Re: Importing non audio files as raw data

Post by ggreene » Fri Mar 07, 2014 2:06 am

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.

Post Reply