Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Sound wave

Author
Message
kraftwerk
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: isle of wight
Posted: 14th Feb 2011 11:51
Hallo
Is it possible to write wave data to a sound thats playing.
I want to add waveforms Real time.And if so do i use memory blocks or array to transfer it from.
cheers anyone

http://www.facebook.com/januscloud
enderleit
17
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 16th Feb 2011 14:25
Not that I know off...

Usually to create sounds you have to create it in a memblock first and then use: make sound from memblock SoundNo, MemblockNo

You can't do this to a sound that already exists...

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 17th Feb 2011 15:02
If you want this done in real time It will be slow, possibly too slow to use for your desired application.

I think you are better off recording your new wave and playing it the same time as the old wave, and maybe recording the two together as a new file (beware feedback loops)


depending on what you want to do I can give you one *possible* concept which you may try to implement.
It is the idea that bouncing wave files is a matter of adding the two files amplitude to define the new wave amplitude peak.

in short, you need to add the two amplitude levels together to create a merged file. --which becomes more complicated when the volume levels are all positive rather than a measure of alternating current.

to set the resolution of the detection you will need to check the volume of the sound 44,100 times per second - check out nyquist frequency.
so something like sync rate 44,100(if it can be done)

you will need to add the values, however it will be slightly complicated.

you need to check the volume 44,100 times. and every second value needs to be made into a negative value. -these all need to be stored in sequence for all waves.(there may be potential bugs here regarding the posative\negative switch rate, if the waves merge in such a way as to create a posative movement for a duration greater than the sampling rate.)

here we get the positive and negative wave peaks for the 22.05Khz frequency which through resolution contains all other frequencies data. add the values for the two waves.

to create a merged image of the 22.05 frequency band should *in theory* create a merged wave of the two or more reference files creating a "bounced image" (if bugs persist, try the same process with every frequency between 20 and 20khz in intervals defined by the resolution frequency)

Keeping in mind that professional wave recording software has to shut down to its bare bones to bounce an average project of say (2.5 minutes * 8 waves) which takes a minute or two, It may be too slow for your use.

I dont even know if dark basic will behave as expected for Im not sure it was designed with wave manipulation in mind.(I'm a noob i may be wrong, please correct this statement if you know better)

out of curiosity, what are you making? recording software?

The coding for this project is way over my head, I just have a Bit of know how with regard to sound and the way its mapped out, I thought id share Ideas even if I cant convert them to practical code.

dunno If this helps at all, just an idea
kezzla

Sometimes I like to use words out of contents
Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 27th Feb 2011 05:35 Edited at: 27th Feb 2011 05:44
I have an idea. I haven't tried this, and I don't know if it'll work, it's just a logic plan that came to me while reading this thread.

What if you used two sounds, initially with identical content (whatever the sound is that you want to start with). Now, start playing sound 1 while you work with sound 2. You can make sound 2 into a memblock and manipulate it in any way you like. When you're done working with sound 2, stop playing sound 1 and start playing sound 2 from the position we were up to in sound 1. Delete sound 1, and clone sound 2 into it. Now while sound 2 plays with the new updated data, start working on sound 1. Toggle back and forth between the two sounds, with one always playing while you work on the other, and clone them into each other when you're done working per iteration.

I'm sure I read somewhere once that you can play a sound from some arbitrary midpoint, but now I can't seem to find it. If you can work this out, you might be in business.

Login to post a reply

Server time is: 2024-11-23 02:28:15
Your offset time is: 2024-11-23 02:28:15