[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How is raw sound data stored?

Posted on 1997-05-26
5
Medium Priority
?
318 Views
Last Modified: 2013-12-26
I am using SPBRecord to create my own voice-activated recorder.  In order to do this i need to find some way to access the meter level (ie the volume level of the data - an integer from 0 to 255) from the raw data recorded into the buffer ( i think is sample points in the form integer -128 to 127).  How exactly is the sample data stored and how can i retrieve the volume level from this data?
0
Comment
Question by:DylanCranberry
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 

Author Comment

by:DylanCranberry
ID: 1291482
Adjusted points to 150
0
 

Author Comment

by:DylanCranberry
ID: 1291483
I guess what i really want to know is how do i read and manipulate individual samples.  Is there some code somewhere i can use to do this?
0
 

Author Comment

by:DylanCranberry
ID: 1291484
Adjusted points to 175
0
 
LVL 1

Expert Comment

by:byoung
ID: 1291485
audio is generally stored as byte arrays since these are the easiest to compress, manipulate, and store.  The exact encoding and decoding between recording and listening I don't know, the applications decipher the byte arrays.  You might be able to access it using Resedit or something liek that, but watch out cause you could screw something up royally with resedit.  good luck, hope this helps
0
 

Accepted Solution

by:
matthias072397 earned 510 total points
ID: 1291486
Hi,

every sample point is stored as either a signed or unsigned integer. This integer can have 8 or 16 bits. This depends on the sound, and I think you can tell SPBRecord whether you want 8 or 16 bits. More bits mean more quality. Sample data on the Macintosh is always unsigned, i.e. for example for 16 bit data, a sample point ranges between 0 and 65535. The "zero" point is at 32768.

If you want to determine the volume of raw sample data, you can try to add all sample points (convert to signed first by subtracting 32768 and take the absolute value!) and divide by the number of sample points. This gives you a "average" sample point that represents the volume - the higher the point the higher the volume.

Hope this helps.
Matthias
0

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question