 |
 |
|
 |
01-28-2009, 02:43 PM
|
#1 (permalink)
|
|
Photoshop guru
Join Date: Sep 2008
Location: Europe
Posts: 152
|
Scrubbing the audio... is that possible?
Hi, I am doing a game where I have to move boxes on the iphone screen. What I am tring to do is to play a sound while the user is pushing the box and stop the sound when the user stops pushing.
Here is the problem.
I have an audio file that can be put in loop to last the time that is needed, I mean, to be played as long as the user keeps pushing the box.
As playing the sound and moving the box on the same thread freezes the game I have done it on another thread. But I do not like the result. Even working correctly the sound seems to be not syncrhonized with the box movement.
What I need is a kind of scrub on the audio. Imagine using an audio editing program and going forward and back on an audio file, manually, and listening the sound as you move the slider. I mean, listening the sound on the speed you are scrubbing (i.e. moving the slider).
In other words... playing the audio at different speeds and stopping as soon as the user stops sliding.
Any ideas on how to do that?
Last edited by LunarMoon; 01-28-2009 at 02:48 PM.
|
|
|
01-28-2009, 03:15 PM
|
#2 (permalink)
|
|
Registered Member
Join Date: Oct 2008
Posts: 60
|
Assuming you're using audio queues or even the audio unit you could calculate the instantaneous velocity the user is moving the box at each moment and feed in your sound data in chunks of multiples of the velocity? That sounds reasonable in theory. I don't know what that would do to performance, probably not too bad. You could always take velocity samples at a certain interval of time. Hope I understood your problem.
|
|
|
01-28-2009, 08:47 PM
|
#3 (permalink)
|
|
Photoshop guru
Join Date: Sep 2008
Location: Europe
Posts: 152
|
thanks for your answer!!!! I will check around.
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 471 |
| 46 members and 425 guests |
| axeman, beancreative, billk, black666, BrianSlick, Chonch, ChrisJW, ColouredRobot, DanLyons, dany88, dhouse, d_CFO, ggalante, GhostDog, harrytheshark, iPhoneAppStudio, iPhoneDevelopment, javaconvert, jorgmart, josep@sixtemia.com, Kalimba, KenPletzer, lukeca, maiuridavide, marco.mussini75, Maximilian, mebarron, MiniRobinho, mquetel, msu, ng93, nibby, NicolasD, Noise, P2k, PeddlePower, raees, rarindeed, Sai Baba, shibq, Slum, svguerin3, tralhavet, warmi, ziconic, ZunePod |
| Most users ever online was 779, 05-11-2009 at 10:55 AM. |
» Stats |
Members: 21,502
Threads: 35,781
Posts: 156,769
Top Poster: smasher (2,449)
|
| Welcome to our newest member, msu |
|