custom ringtone not playing fully

64 views
Skip to first unread message

rukiman

unread,
Apr 27, 2010, 3:52:05 AM4/27/10
to Siphon
I converted a 20 seconds wav file to caf and it now plays when an
incoming call comes in. However only the first 3 seconds or so are
played over and over again. When the other party hangs up, the
incoming call popup goes away and returns to the dialer and then the
rest of the ringtone continues to play.

Any pointers to what I need to do to get my whole ringtone played
instead of just the first 3 seconds?

--
You received this message because you are subscribed to the Google Groups "Siphon" group.
To post to this group, send email to sip...@googlegroups.com.
To unsubscribe from this group, send email to siphon+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/siphon?hl=en.

Samuel Vinson

unread,
Apr 27, 2010, 6:39:53 PM4/27/10
to sip...@googlegroups.com
It's logic, because it's impossible to stop sounds play with AudioServicesPlayAlertSound.
To repeat the sound there are a timer with 4 seconds of delay.
You listen the end of the ringtone because we can't try to re-play the sound.

Maybe you find a solution to stop sound ;-)

Samuel

2010/4/27 rukiman <ruks...@optushome.com.au>

rukiman

unread,
Apr 28, 2010, 2:05:44 AM4/28/10
to Siphon
Thanks Samuel. Though if seems like when this API is called again it
immediately stops playing the current ringtone and starts it again
from the beginning. So my thinking is it maybe still possible to play
a long ringtone. When it is time to stop the ringtone then we can
simply call this function again with a short silent CAF file. What do
you think?

On Apr 28, 8:39 am, Samuel Vinson <samuelv0...@gmail.com> wrote:
> It's logic, because it's impossible to stop sounds play with
> AudioServicesPlayAlertSound.
> To repeat the sound there are a timer with 4 seconds of delay.
> You listen the end of the ringtone because we can't try to re-play the
> sound.
>
> Maybe you find a solution to stop sound ;-)
>
> Samuel
>
> 2010/4/27 rukiman <ruksh...@optushome.com.au>
>
>
>
>
>
> > I converted a 20 seconds wav file to caf and it now plays when an
> > incoming call comes in. However only the first 3 seconds or so are
> > played over and over again. When the other party hangs up, the
> > incoming call popup goes away and returns to the dialer and then the
> > rest of the ringtone continues to play.
>
> > Any pointers to what I need to do to get my whole ringtone played
> > instead of just the first 3 seconds?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Siphon" group.
> > To post to this group, send email to sip...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > siphon+un...@googlegroups.com<siphon%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/siphon?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Siphon" group.
> To post to this group, send email to sip...@googlegroups.com.
> To unsubscribe from this group, send email to siphon+un...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/siphon?hl=en.

Samuel Vinson

unread,
Apr 28, 2010, 4:39:27 PM4/28/10
to sip...@googlegroups.com
I don't know, but I think it would be a good idea

Samuel

2010/4/28 rukiman <ruks...@optushome.com.au>

rukiman

unread,
Apr 29, 2010, 3:05:58 AM4/29/10
to Siphon
I tried my suggestion and it did not work. However I discovered that
calling AudioServicesDisposeSystemSoundID() stops the ringtone from
playing immediately. So I think the best way forward for me is to
modify the code to call AudioServicesCreateSystemSoundID() at ring
start and AudioServicesDisposeSystemSoundID at ring end.

Also I noticed you are using a timer, however that causes an issue of
not knowing when to restart the ringtone. So its better to change over
from using a timer to registering a callback using
AudioServicesAddSystemSoundCompletion() which tells you when the sound
has finished playing.


On Apr 29, 6:39 am, Samuel Vinson <samuelv0...@gmail.com> wrote:
> I don't know, but I think it would be a good idea
>
> Samuel
>
> 2010/4/28 rukiman <ruksh...@optushome.com.au>
> > <siphon%2Bunsu...@googlegroups.com<siphon%252Bunsubscribe@googlegroups. com>

Samuel Vinson

unread,
Apr 30, 2010, 9:22:56 AM4/30/10
to sip...@googlegroups.com
Exactly, you use the good fonction to know when the sound stop.
Create and destroy system sound it don't take much time?

2010/4/29, rukiman <ruks...@optushome.com.au>:

rukiman

unread,
May 2, 2010, 5:01:04 AM5/2/10
to Siphon
Hi Samuel I implement the ringtones as I described and works
perfectly. I still retained your timer so I can use that to vibrate
every few seconds as you had it. However the system sounds are
replayed on the system callback
AudioServicesAddSystemSoundCompletion().
There is no noticeable delay with creating and destroying the system
sounds. Also now the ringtone stop immediately when the call is
answered or declined.
The only extra work you will need to do on your ringtone files is edit
them to add extra silent padding otherwise the siphon bundled
ringtones play too fast without any delay inbetween.
Our custom ringtones play quite well however. I am happy to email you
my ring.m file if you wish.

On Apr 30, 11:22 pm, Samuel Vinson <samuelv0...@gmail.com> wrote:
> Exactly, you use the good fonction to know when the sound stop.
> Create and destroy system sound it don't take much time?
>
> 2010/4/29, rukiman <ruksh...@optushome.com.au>:
Reply all
Reply to author
Forward
0 new messages