Asynchronous Audio on Windows?

Chris Sheffield cmsheffield at icloud.com
Wed Jan 16 10:40:36 EST 2013


Do you have this latency with all sound files played, or just the first one played?

The reason I ask is because I've noticed that sometimes there is a delay while the very first sound file is "loaded" (maybe buffered is a better term; not sure). Anyway, a trick I've used in the past (not sure who gave me the idea initially) is to play a short sound file with nothing but a second (or even less) of silence when the stack/application loads. This gets the sound engine going and I don't usually experience any delays after that. I've usually done this in the preOpenCard handler of the first card in the stack.

Not sure if that's something that would help or not, but thought I'd throw it out there.

Chris


On Jan 15, 2013, at 11:23 PM, Scott Rossi <scott at tactilemedia.com> wrote:

> Even if the player option could work, there's the issue of latency.  It
> takes a noticeable amount of time to load an external sound in the player
> and play it.  This is one of the benefits of using embedded sounds --
> speedier playback (the tradeoff being only one sound played at a time).  I
> suppose I could have multiple players all preloaded with the sounds I
> need, but what a chore.
> 
> Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX Design
> 
> 
> 
> 
> On 1/15/13 12:55 PM, "Chris Sheffield" <cmsheffield at icloud.com> wrote:
> 
>> Hmm, interesting. I'm trying to remember how we did it. It's been some
>> time ago.
>> 
>> I just reviewed my code from nearly three years ago. Yikes! :-) So it
>> looks like originally we checked the QTVersion to determine if QT was
>> installed or not. This worked fine on a Mac, since QT was always
>> installed. But in April of 2010, I commented out the code that does the
>> QT check. Turns out it caused more problems, and actually caused the
>> engine to attempt to load QT even though it wasn't installed. As a
>> result, audio playback was erratic. So basically, if QT turns out to be
>> installed, great. The engine will make use of QT for playing back audio
>> files through a player object. If QT is *not* installed, that should be
>> fine too, as some version of WMP was usually always installed, and the
>> engine would make use of that in that case. I do believe this still
>> causes the player object to lose it's playback controls, so you can't
>> really let the user control playback in that case, but our app didn't
>> require that anyway.
>> 
>> So, I'm not sure if you have a machine available without QT installed,
>> but if so, give it a try. Maybe you could set up a VM to try it in? I
>> think it should work okay for you.
>> 
>> Good luck.
>> 
>> On Jan 15, 2013, at 1:17 PM, Scott Rossi <scott at tactilemedia.com> wrote:
>> 
>>> Hi Chris:
>>> 
>>> Over here, when I set the dontUseQT to true, the player (which has the
>>> file path of a WAV assigned) displays with no controller and scripting
>>> "start player 1" results in "could not open video player", whereas this
>>> works when QT is normally enabled.  Maybe the result is different on a
>>> system that truly has no QT.
>>> 
>>> I might be wrong, but I don't think this has worked for a long time, if
>>> ever.
>>> 
>>> Regards,
>>> 
>>> Scott Rossi
>>> Creative Director
>>> Tactile Media, UX Design
>>> 
>>> 
>>> 
>>> 
>>> On 1/15/13 11:36 AM, "Chris Sheffield" <cmsheffield at icloud.com> wrote:
>>> 
>>>> Unless something has changed in the last couple years, external audio
>>>> should work just fine using a player object, even if QT is not
>>>> installed.
>>>> Read Naturally has a desktop application (it's kind of old and outdated
>>>> now) but it supported Windows and Mac. We recommended QT on Windows,
>>>> but
>>>> it wasn't required. Having it installed made things a bit easier (seems
>>>> like there were some limitations if it wasn't), but audio playback
>>>> worked
>>>> regardless. So it might be worth a try.
>>>> 
>>>> On Jan 15, 2013, at 11:41 AM, Scott Rossi <scott at tactilemedia.com>
>>>> wrote:
>>>> 
>>>>> Hi Chris:
>>>>> 
>>>>> I'm pretty sure the only way to use external files is if QT is
>>>>> installed,
>>>>> which I'd rather not have to force on users, but it may come to that.
>>>>> 
>>>>> I'm just kind of shocked.  It's 2013 and LiveCode is still in the
>>>>> dinosaur
>>>>> age when it comes to audio.  :-/
>>>>> 
>>>>> Thanks & Regards,
>>>>> 
>>>>> Scott Rossi
>>>>> Creative Director
>>>>> Tactile Media, UX Design
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On 1/15/13 10:17 AM, "Chris Sheffield" <cmsheffield at icloud.com> wrote:
>>>>> 
>>>>>> I want to say using the "play" command with imported files is
>>>>>> blocking
>>>>>> on
>>>>>> one of the platforms (Windows?) and always has been, but I could be
>>>>>> wrong
>>>>>> about that. Can you try using a player with external files instead,
>>>>>> or
>>>>>> do
>>>>>> you have to use imported files?
>>>>>> 
>>>>>> Chris
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Chris Sheffield
>>>>>> Read Naturally, Inc.
>>>>>> www.readnaturally.com
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On Jan 15, 2013, at 11:04 AM, Scott Rossi <scott at tactilemedia.com>
>>>>>> wrote:
>>>>>> 
>>>>>>> Does anybody know if there's some trick or secret to getting sounds
>>>>>>> to
>>>>>>> play
>>>>>>> asynchronously along with events on Windows?
>>>>>>> 
>>>>>>> I have a stack that supplements user interaction with audio
>>>>>>> feedback:
>>>>>>> clicks, chimes, etc.  I'm finding that all events are delayed by the
>>>>>>> use of
>>>>>>> sound, in that the events don't trigger until the sound has finished
>>>>>>> playing.  The sounds are imported WAV files of the correct sample
>>>>>>> rate/bits
>>>>>>> (they play fine).  If I disable sound playback, all UI events
>>>>>>> respond
>>>>>>> as
>>>>>>> expected.
>>>>>>> 
>>>>>>> It's been a while since I built anything with audio on Windows --
>>>>>>> maybe
>>>>>>> I
>>>>>>> just never ran into this ‹ but the app is unusable when audio is
>>>>>>> enabled.
>>>>>>> On OS X, everything works fine without delays, so I don't believe
>>>>>>> there's
>>>>>>> any problem with the stack.
>>>>>>> 
>>>>>>> Am I missing something?  Is audio feedback just not doable on
>>>>>>> Windows
>>>>>>> without resorting to an external?
>>>>>>> 
>>>>>>> Thanks for any suggestions.
>>>>>>> 
>>>>>>> Regards,
>>>>>>> 
>>>>>>> Scott Rossi
>>>>>>> Creative Director
>>>>>>> Tactile Media, UX Design
>>>>>>> 
>>>>>>> 
>>>>>>> _______________________________________________
>>>>>>> use-livecode mailing list
>>>>>>> use-livecode at lists.runrev.com
>>>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>>>> subscription preferences:
>>>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> use-livecode mailing list
>>>>>> use-livecode at lists.runrev.com
>>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>>> subscription preferences:
>>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> use-livecode mailing list
>>>>> use-livecode at lists.runrev.com
>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>> subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>> 
>>>> 
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list