Click here to Skip to main content
15,885,366 members
Articles / Desktop Programming / MFC

SDI (Sound Device Interface)--A library for Auditory Display

Rate me:
Please Sign up or sign in to vote.
4.60/5 (3 votes)
2 May 20046 min read 110.2K   3.7K   45  
A GDI-like API for 3D positioning of speech, and MIDI composition using a single string.
  Possibly due to the evaluation version of ViaVoice TTS SDK, I found out that eciSpeaking didn't work! So I add one more
thread to each Speech object, only to find I can't achieve actual Pause function on the Speech object, because ECI
(API provided by ViaVoice TTS) do NOT support thread-reentry.
  For Earcon, I found something really interesting and, well, frustrating indeed. When you play DirectSound Buffer, the 
play cursor will erase the data it's read. The illustration below describes what the DirectSound Buffer looks like when 
a specific notification point is encounted.

[Open DS_Buffer.gif]

  From the picture above, you can see that I have only 70ms to lock the buffer and copy the data between two notification
points to A3D source buffer, if I want to achieve best positioning effect. The test was disappointing. Because I can't finish
processing in 70ms, some notifications were lost and the sound coming out of my earphone is dreadful. (The code in 
WAIT_OBJECT_0+1 section in SDIEarconThread was used for this heavy work.) So I have to fall back on DirectX itself. However,
although I specify DS3DALG_HRTF_FULL for DSound buffers, the positioning is still unsatisfactory.
  I've thought about creating MS synthesizer object manually and call IDirectMusicSynth::Render to pull the synthesized 
wave data. That way I should have enough time to transfer the data to A3D. But this method requires that I fill the 
instrument data manually, too! That means I have to study the Downloadable Sounds Specification, and ....you know, I'm 
just a university student and I have more important things to do. So, if you are interested in this, you can implement a 
better Earcon. And do let me know when you've finished, OK? ^_^ 

Dong Lin
jonathan1983@126.com

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Engineer
China China
A student at Zhejiang University, Zhejiang, China.
Major in Automation.
Now I want to study machine vision and robotics, but I'm really consumed with choices between hardware and software, and between research and engineering.
I'll be glad if you can give some suggestions.

Comments and Discussions