It is currently Tue Sep 24, 2019 10:35 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: [Done] PlaySound limited to 6min 3sec
PostPosted: Sun Jul 21, 2019 1:58 pm 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1013
Location: Portugal
Just tried with my simple ogg player here https://www.purebasic.fr/english/viewtopic.php?f=12&t=73239 with a piece of music which is 18m long.

The length of the sound is reported as 6min3sec by Playsound()

A bit of code to illustrate
Code:
UseOGGSoundDecoder()

Define CurrentSound.i,CurrentLength.l,Mins.i,secs.i
Define trackTime.s

InitSound()

CurrentSound = LoadSound(#PB_Any, "C:\CD Media\Arlo Guthrie\Arlo Guthrie - Alice's Restaurant.ogg") ; 18 minutes plus
CurrentLength = SoundLength(CurrentSound, #PB_Sound_Millisecond)

Debug CurrentLength


secs = Mod(currentLength,60000)/1000

mins = currentLength/60000
 
TrackTime = Str(mins) + "m" + Str(secs) + "s"
 
Debug TrackTime



Any ideas?

CD

PS maybe linked to this post
https://www.purebasic.fr/english/viewtopic.php?f=13&t=59824

tried with Bohemian rhapsody by Queen 5Mins 58Sec and all ok. just anything over 6mins it seems.

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
 Post subject: Re: PlaySound limited to 6min 3sec
PostPosted: Tue Jul 23, 2019 1:37 am 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1013
Location: Portugal
Confirmed with .flac as well same limit 6m3s

.wav reports length ok at 18m 39s

win 7.0 home premium and PB 5.70 LTS

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
 Post subject: Re: PlaySound limited to 6min 3sec
PostPosted: Wed Jul 31, 2019 7:47 am 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1013
Location: Portugal
After some discussion on another thread it appears to be a restriction on the buffer used for .ogg and .flac files not .wav.

If anyone wants to check here is a bit of code to help. You will need a song in ogg, flac and wav to test fully.

Code:
InitSound()           ; Initialize Sound system
UseOGGSoundDecoder()  ; Use ogg files

Global Window_0

Global ProgressBar_0,txtPlayed

Window_0 = OpenWindow(#PB_Any, 0, 0, 600, 400, "Test PlaySound()", #PB_Window_SystemMenu)
ProgressBar_0 = ProgressBarGadget(#PB_Any, 40, 120, 430, 10, 0, 1116, #PB_ProgressBar_Smooth)
txtPlayed = TextGadget(#PB_Any, 30, 20, 200, 20, "")
AddWindowTimer(Window_0, 123, 1000)
 
;With Streaming Flag
;LoadSound(2,"C:\CD Media\Arlo Guthrie\Arlo Guthrie - Alice's Restaurant.ogg",#PB_Sound_Streaming)
 
;Without Streaming Flag
LoadSound(2,"C:\CD Media\Arlo Guthrie\Arlo Guthrie - Alice's Restaurant.ogg")
 
;Start The Sound
PlaySound(2)

Repeat
   
  Event = WaitWindowEvent()
 
  If Event = #PB_Event_Timer And EventTimer() = 123

    If SoundStatus(2) = #PB_Sound_Playing
     
      Played.i = (Played.i + 1)
      SetGadgetState   (ProgressBar_0, Played)
      SetGadgetText(txtPlayed,"Played For " + Str(Played) + " Seconds")
    Else
     
      Debug "Song Finished At " + Str(Played)
    EndIf
 
  EndIf

  Select Event
    Case #PB_Event_CloseWindow
      End

    Case #PB_Event_Menu
      Select EventMenu()
      EndSelect

    Case #PB_Event_Gadget
      Select EventGadget()
      EndSelect
  EndSelect
 
ForEver


Can anyone else confirm?

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
 Post subject: Re: PlaySound limited to 6min 3sec
PostPosted: Wed Jul 31, 2019 8:49 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 520
I can confirm this i played a ogg (8 min 20 sec) it stopped @ 5 min and some sec
(PureBasic 5.62 x64)


Top
 Profile  
Reply with quote  
 Post subject: Re: PlaySound limited to 6min 3sec
PostPosted: Wed Jul 31, 2019 9:28 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 1649
Location: Germany
I can confirm the limitation bug reporting a length of 6:03 minutes for an Ogg file with a length of 6:40 minutes in Windows. For testing I have downloaded this Ogg file from Wikimedia commons.

I have taken collectordave's example from his 1st posting and tested it with the downloaded Ogg file on Linux, MacOS and Windows. Only on Windows a wrong length is reported:
6m40s - MacOS 10.6.8 'Snow Leopard' with PB 5.46 x86 in ASCII and Unicode mode
6m40s - MacOS 10.6.8 'Snow Leopard' with PB 5.62 x86
6m40s - Linux Mint 19.1 x64 'Tessa' with Cinnamon using GTK2 and GTK3 with PB 5.70 x64
6m3s - Windows 7 x64 SP1 with PB 5.70 x86 and x64


Top
 Profile  
Reply with quote  
 Post subject: Re: PlaySound limited to 6min 3sec
PostPosted: Fri Aug 09, 2019 9:45 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13614
Location: France
Fixed.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PlaySound limited to 6min 3sec
PostPosted: Fri Aug 09, 2019 10:33 am 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1013
Location: Portugal
Just downloaded latest PB release 5.7 beta and tried.

Still the same what am I missing?

CD

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PlaySound limited to 6min 3sec
PostPosted: Fri Aug 09, 2019 10:35 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3443
Location: Netherlands
collectordave wrote:
Still the same what am I missing?

Fixed means that it will be included in the next beta.
You would have to wait for the next beta version.

_________________
macOS 10.14 Mojave, PB 5.62 x64


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PlaySound limited to 6min 3sec
PostPosted: Fri Aug 09, 2019 10:36 am 
Online
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 2:15 pm
Posts: 821
Location: Cuernavaca, Mexico
The issue has been fixed, but you won't see the fix until the next software release.
e.g. 5.71 beta 3

_________________
- It was too lonely at the top.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PlaySound limited to 6min 3sec
PostPosted: Sat Aug 10, 2019 11:52 am 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1013
Location: Portugal
PB 5.71 Beta 3

Works a treat plays 18 minute song no bother.

Brilliant

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye