Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^3: Audio::WAV data problem

by graff (Chancellor)
on Apr 19, 2013 at 20:21 UTC ( #1029576=note: print w/replies, xml ) Need Help??

in reply to Re^2: Audio::WAV data problem
in thread Audio::WAV data problem

I do not understand most of what you say here (and your subsequent replies to yourself). If you are using a "simple text file format", then why are you dealing with binary integer data as if it were 16-bit audio samples?

If you are actually manipulating 16-bit integer values (not strings of digit characters), why do you start with a text file?

As for the kinds of "editing" you want to do (cutting, pasting, scaling, etc), you might need to look at some sort of binary data editing facility that is not tailored to audio data. Tools like Audacity, being focused on audio data, tend to have a lot of built-in assumptions about what "makes sense" for data manipulation, given that it's assumed to be audio. (For example, some operations will impose "dithering" - randomly adding 1 or -1 to each sample value, others will impose various kinds of frequency-domain filtering, etc.)

Since you are not dealing with audio data, those built-in assumptions will have unintended consequences, and might make it impossible to do what you really want to do (whatever that is, really... I still don't understand that part).

Replies are listed 'Best First'.
Re^4: Audio::WAV data problem
by spencoid (Acolyte) on Apr 20, 2013 at 06:05 UTC
    the files i am writing are representations of 16 bit integers but packed as 8 bit unsigned values so the files can be written and read as text files. i don't remember why i decided to do it this way but the packing and uppacking are worked out and it all works fine from the microcontroller. i plan to leave it this way because it works. i am not concerned with absolute precision in the data. dithering of +- 1 out of 32k is not of any concern other than in testing where it seemed to indicate some sort of error. i need a visual editor that displays the whole file and that allows easy editing with simple tools to change amplitude frequency of variation in variations etc. the idea is to make it easy to make rather crude edits without concern for editing each sample individually. it is just the overall trends that need to be modified. just as in an audio file, i want to edit in a general sense, not sample by sample but do want to reserve that option in case it is necessary. this is why Audacity is perfect for my needs. the only problem is testing because i was not aware of the strange little modifications to the file that Audacity made. they are not significant but just confused the testing. i wrote replies to myself only because i do not know how to update a previous posting. the problem is solved with the help of those who helped me to see that there were no problems with the Perl code.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1029576]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2018-04-21 10:49 GMT
Find Nodes?
    Voting Booth?