I'm using the pc's bluetooth & soundcard to receive pulses from a remote transmitter (basically rigged an old bluetooth phone earpiece to a heartrate monitor receiver to wirelessly log heartbeats).
PC receives 20ms pulses every heartbeat, which is roughly every second or so, varies between say 60 bpm to 200 or so bpm, i.e. about 1 to 3 hz square wave with extremely short on duty cycle.
Anyway, I can't fathom directsound examples of measuring volume etc. I think all I need to do is set some low threshold volume level and grab the time (to the millisecond) that a each pulse occurs, then use periods between thuds to generate heartrate. It's really easy to do with mouseclicks ! but I dont see how to get at the soundstream? - some examples I've seen involve pages of code but it just shouldn't be that involved should it ?
Can anyone help please ? I'm ok with the coding except for the sound time grabbing bit. Cheers.
PC receives 20ms pulses every heartbeat, which is roughly every second or so, varies between say 60 bpm to 200 or so bpm, i.e. about 1 to 3 hz square wave with extremely short on duty cycle.
Anyway, I can't fathom directsound examples of measuring volume etc. I think all I need to do is set some low threshold volume level and grab the time (to the millisecond) that a each pulse occurs, then use periods between thuds to generate heartrate. It's really easy to do with mouseclicks ! but I dont see how to get at the soundstream? - some examples I've seen involve pages of code but it just shouldn't be that involved should it ?
Can anyone help please ? I'm ok with the coding except for the sound time grabbing bit. Cheers.