Generate Tones

59 views
Skip to first unread message

Alan Hendry

unread,
Oct 12, 2020, 5:16:07 AM10/12/20
to DroidScript
HI,
Is it possible to generate tones (sounds) in DS?
For example middle C is  261.63 Hz. 
Regards, ah

Dave

unread,
Oct 12, 2020, 7:51:40 AM10/12/20
to DroidScript
Yes check out the 'Audio Signal' sample

Alan Hendry

unread,
Oct 12, 2020, 9:19:47 AM10/12/20
to DroidScript
Dave,
Thanks, I was searching for music or tones or generate.
b.t.w. Slight typo on CreateSynth "ca produces" should probably be "can produce"
Regards, ah

Alan Hendry

unread,
Apr 22, 2021, 9:22:17 AM4/22/21
to DroidScript
Hi,
Supplementary Questions - 
Can we send sounds to one specific ear?
Or different volume to each ear? (stereo)
And/or have a slight delay to one ear (spatial audio)?
Or the same questions for PlaySound/MediaPlayer/PlayRingTone/TextToSpeech?
Regards, ah

Steve Garman

unread,
Apr 22, 2021, 1:03:44 PM4/22/21
to DroidScript
I would like to put on record that I don't know quite enough to categorically state that DroidScript does not do these things 

old-style emoticon added to prove to myself that Google groups changes it when I type that ;-)

Dave

unread,
Apr 22, 2021, 4:53:15 PM4/22/21
to DroidScript
You can set the left and right volume on the MediaPlayer object


The new Music component has quite a lot of functionality and is a wrapper for WebAudio and you can get access to the underlying WebAudio context if required too.  You can do all sorts of amazing things with WebAudio (probably everything that you need) , but it might not be straight forward to implement (that's why we wrote a wrapper for it)

Reply all
Reply to author
Forward
0 new messages