DirectSound-Buffer manipulating

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

DirectSound-Buffer manipulating

Post by Hroudtwolf »

An good idea for the next pure basic would be ,DirectSound-Buffer manipulating commands.
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

indeed, I want some sound buffers!
Maybe something like this:
LoadSound(#Sound, FileName$ [, Buffers])
I like logic, hence I dislike humans but love computers.
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

I mean new commands to manipulate the soundbuffer directly.

Example:

result.l = GetInputSignal (mixer.l)
result.l = SetBaseFrequency (Sound.l); in percent
result.l = SetMiddleFrequency (Sound.l); in percent
result.l = SetHighFrequency (Sound.l); in percent
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Hroudtwolf wrote: result.l = GetInputSignal (mixer.l)
result.l = SetBaseFrequency (Sound.l); in percent
result.l = SetMiddleFrequency (Sound.l); in percent
result.l = SetHighFrequency (Sound.l); in percent
Sorry, what are these commands supposed to do?
Good programmers don't comment their code. It was hard to write, should be hard to read.
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

traumatic wrote:
Hroudtwolf wrote: result.l = GetInputSignal (mixer.l)
result.l = SetBaseFrequency (Sound.l); in percent
result.l = SetMiddleFrequency (Sound.l); in percent
result.l = SetHighFrequency (Sound.l); in percent
Sorry, what are these commands supposed to do?
Just an example,of course ...

result.l = GetInputSignal (mixer.l) ; Get the actual samplevolume( For effekts like spectrum-analyzers)
result.l = SetBaseFrequency (Sound.l,percent.l); Set the base-frequency of your sound(for equalizers)
SetMiddleFrequency ,SetHighFrequency for nearly the same.But for the other frequency-spectrums.
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

traumatic wrote: Sorry, what are these commands supposed to do?
Just an example,of course ...

result.l = GetInputSignal (mixer.l) ; Get the actual samplevolume( For effekts like spectrum-analyzers)
result.l = SetBaseFrequency (Sound.l,percent.l); Set the base-frequency of your sound(for equalizers)
SetMiddleFrequency ,SetHighFrequency for nearly the same.But for the other frequency-spectrums.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

IsSoundPlaying(#Sound) and OGG Stream would be more important.

c ya,
nco2k
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

Hroudtwolf>you can't do a spectrum analyzer only with the sound volume value, you ll have to FFT the signal and the fonction will then return you an array of linear (or not) values of the signal.
I don't understand the SetBaseFrequency function ?
For the Middle, High, Low frequencies, you can write a biquad filter or, better, a FIR filter with windowing or remez polynominal interpretation.
Remember that the LoadSound PB function return you a DIRECTSOUNDBUFFER(8 ?) pointer.
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Post Reply