Play sound backwards in Corona SDK - audio

I am trying to make a voice recorder that plays the sound backwards with Corona SDK. It seems to be possible with Xcode, so is there a solution for Corona as well?
I tried to use a function that plays small bits from the end to the beginning, it sounds quite backwards, but when I make the duration less than 20, it can’t handle it any more.
function playBackwards()
moment = moment-20
if moment > 0 then
audio.seek(moment, playbackSoundHandle)
audio.play(playbackSoundHandle, {duration = 20, onComplete=playBackwards})
else
onCompleteSound()
end
end

The Duration time unit is milliseconds, and 20 milliseconds is really short time, I think you want set the time as 20 seconds, and that means 20,000 milliseconds.

Related

Real duration of audios played through browsers

I need to play 4 audios through a browser web.
These audios last 150ms, 300ms, 450ms and 600ms.
I don't care about latency (if an audio is played 100 ms after it's not that important for my purpose).
But I do care about the duration of these audios: is the 150ms audio last exactly 150ms or there is an error due to the audio board or other components?
I know for sure that there is an error (I see a test using a Mac).
My question is: can anyone show me a paper, an article or anything that talks about the duration and test different setting or tell me if this error is always (Windows, Mac, old device, new device) very small (less than 10ms for example).
In other words: if I play an audio of 100ms how long does it really last (100ms? more? less?)?
In what manner is the sound not lasting the correct amount of time?
Does the beginning or the end get cut off?
Does the sound play back slower or faster than it should?
In my experience, I've never heard an error with playback rates caused by the browser or sound boards. But I have come across situations where a sound is played back with a different audio format than which is was encoded. For example, a sound encoded at 48000 fps played back at 44100 fps will take longer to execute, but will be very close to the original in pitch (maybe about a 1/2 step lower). I recommend as a diagnostic step to confirm the audio format used at each end. How to do so will depend on the systems being used.

Delay Audio on Windows 10 by a second

Is there a way to universally delay audio in Windows 10 (I have Realtek Hi-Definiton Audio) as an example.
I have 2 reasons why I want to accomplish this
1) My audio is playing a quarter of a second before the video plays (out of sync). This is consistent in youtube, vlc media player, windows media player, pretty much any video content... the mouth will move 1/4 second after the audio. The delay builds up overtime as well, about 5 minutes in it becomes unbearable.
2) Unrelated to #1 I want to scan the audio and edit it in near real time. Searching for certain sounds and also reading certain subtitles.

Speaker Recognition and Response Time?

I know that Speaker Recognition is in preview and the only available location is the West Coast, and Im hoping that's why I am seeing this 'delay'.
Im on the East Coast (NY) and with just 3 speakers in my search it takes 6 seconds to return a confirmation. Dont get me wrong, 6 seconds is impressive for what it does but that long of delay makes the use case more limited than a quicker reply.
Main question is - Should I see a quicker reply once the service adds location closer? (Its not like the latency should cause a big issue...) - Or is there anything else that may speed up replies - or, of course, is this simply 'The way its going to be'??
Thanks!
I assume you're talking about Microsoft Speaker Recognition.
The processing time is a function of the audio length. For a 15 seconds audio, you can expect less than 1 second latency, and yes, in general, you should see quicker response when the service expands to closer locations.

audio weird "tick sound" at track end

i created an app which plays a playlist of small tracks every thing was working fine , till windows phone 8.1 update
the problem is -> there is weird tick sound" at track end
so i tried to play the track in xbox music player it also has the same tick ... i tried to play the audio at my pc and android device the audio is okay, so i think it's a wp8.1 issue or a comparability issue with my mp3 tracks
so, is there any specifications for the mp3 to be compatible with wp8.1?
or any work around in code, i was thinking a bout muting the sound before the track end , by the way i'm using AudioPlayerAgent
All audio rendering processes encounter this same challenge/problem. Root cause : sound is a curve and as it varies above/below centerline, (typically varies from -1 to 0 to +1 where centerline is 0), if it ends not close enough to the centerline this pop/tick sound happens, (speaker is left in the lurge not at 0 and will physically instantaneously return to 0 producing the tick). Solution : either the player ~helps~ the sound by artificially forcing the hand by ending the clip at the centerline or do similar as a preprocess step in the source media. This ending transition can happen quickly, yet not instantaneously, or you'd be back where you started with the instantaneous transition to 0. Silence is just when the media supplies a series of zeros (IE. at centerline).

HLS 10 second segment and seeking

Apple recommends having hls segments of 10 seconds, however this means that seeking would be limited to every 10 seconds.
I have tried shorter segments of 3 seconds and this is better for seeking but this is not ideal or recommended.
Is there anyway of keeping the segments at 10 seconds but allowing for better seeking?
Would adding a key frame every 30 frames (1 key frames every second) allow for better seeking?
Ultimately, it depends upon your player. If I'm watching a video with the default iPad player, I can navigate via the progress bar on the bottom and seek to any point in the video, and it works very well, regardless of segment length or key frame cadence.
Some players support the #EXT-X-I-FRAMES-ONLY attribute. This implementation of trick play works by only playing back the intra frames. This was introduced in version 4 of the Pantos spec, and I have only seen it working well on newer iPads. A good sample clip can be found here.

Resources