Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-28-2009, 01:43 PM   #1 (permalink)
Photoshop guru
 
Join Date: Sep 2008
Location: Europe
Posts: 153
Default 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 01:48 PM.
LunarMoon is offline   Reply With Quote
Old 01-28-2009, 02:15 PM   #2 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 60
Default

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.
lymeric is offline   Reply With Quote
Old 01-28-2009, 07:47 PM   #3 (permalink)
Photoshop guru
 
Join Date: Sep 2008
Location: Europe
Posts: 153
Default

thanks for your answer!!!! I will check around.
LunarMoon is offline   Reply With Quote
Reply

Bookmarks

Tags
scrubbing audio

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,144
Threads: 38,921
Posts: 170,764
Top Poster: smasher (2,565)
Welcome to our newest member, HovRay567
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:01 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0