Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 04-06-2011, 02:45 PM   #1 (permalink)
Registered Member
 
vincefried's Avatar
 
Join Date: Apr 2010
Location: Hamburg, Germany
Posts: 38
vincefried is on a distinguished road
Default Peer-to-Peer adjust latency

Hey there,

following problem: I have an app, that starts a sound on two devices, connected over p2p. I want to start the sounds at the same time. I tried to do that over p2p, and it works, but there's a little latency between the starts. Is there any way to let one device wait for the other, so that the two devices could start the sound at the same time?

Sincerely,
vincefried
__________________
My Apps:
Adalbert sagt.. (Germany only)
vincefried is offline   Reply With Quote
Old 04-06-2011, 07:58 PM   #2 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by vincefried View Post
Hey there,

following problem: I have an app, that starts a sound on two devices, connected over p2p. I want to start the sounds at the same time. I tried to do that over p2p, and it works, but there's a little latency between the starts. Is there any way to let one device wait for the other, so that the two devices could start the sound at the same time?

Sincerely,
vincefried
The big problem with latency is that it can vary from message to message. That makes it hard to get good synchronization between devices over a network.

Assuming the clocks on the two devices are synchronized, send an NSTimeInterval that represents a time in the near future. Use that to start a timer on both machines. When the timer goes off, play the sound on both devices.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Reply

Bookmarks

Tags
bluetooth, latency, p2p, peer-to-peer, sound

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



» Advertisements
» Online Users: 366
12 members and 354 guests
dansparrow, dre, ilmman, LezB44, michelle, Nobbsy, Objective Zero, samdanielblr, Sami Gh, shagor012, thephotographer, tinamm64
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,119
Posts: 402,896
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:41 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0