LB Booster
« New to lbb & coding - Mp3 shuffle player »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:56am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: New to lbb & coding - Mp3 shuffle player  (Read 428 times)
mattlp1980
New Member
Image


member is offline

Avatar




PM


Posts: 2
xx New to lbb & coding - Mp3 shuffle player
« Thread started on: Sep 17th, 2015, 9:34pm »

Hi all new to lbb & coding so need to start at beginning wink

Looking to create an Mp3 shuffle player (shuffle default) to shuffle 1000+ 1 - 2 second audio files from set directory with option of play speed via a slider.

Set a created Jpeg as player background.

Just looking for best read or e-books to learn required coding.

Thanks in advance
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: New to lbb & coding - Mp3 shuffle player
« Reply #1 on: Sep 17th, 2015, 10:44pm »

on Sep 17th, 2015, 9:34pm, mattlp1980 wrote:
Looking to create an Mp3 shuffle player

Here's a very simple MP3 player. Hopefully you can achieve most of what you want by means of other MCI commands, there's a list at MSDN.

Code:
    filedialog "Select an MP3 file", "*.mp3", mp3file$
    if mp3file$ = "" then end
    
    ret$ = mciSendString$("open " + chr$(34) + mp3file$ + chr$(34) + _
                          " type mpegvideo alias music")
    ret$ = mciSendString$("play music")
    if ret$ = "" then print "Playing "; mp3file$
    end

function mciSendString$(s$)
    buffer$ = space$(1024)+chr$(0)
    buflen = len(buffer$)
    calldll #winmm, "mciSendStringA", s$ as ptr, buffer$ as ptr,_
      buflen as long, 0 as long, ret as short
    if ret then
        mciSendString$ = "error ";ret
    else
        mciSendString$ = trim$(buffer$)
    end if
end function 

Richard.
« Last Edit: Sep 17th, 2015, 10:53pm by Richard Russell » User IP Logged

mattlp1980
New Member
Image


member is offline

Avatar




PM


Posts: 2
xx Re: New to lbb & coding - Mp3 shuffle player
« Reply #2 on: Sep 17th, 2015, 11:07pm »

Thank you Richard that's a great start.

Would I add files names in same line to play multiple audio files what would separate each mp3 file name? \ | : ,

or can I set a directory as default to play via a button without allowing users to choose a file?

Matt



User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: New to lbb & coding - Mp3 shuffle player
« Reply #3 on: Sep 18th, 2015, 02:01am »

on Sep 17th, 2015, 11:07pm, mattlp1980 wrote:
or can I set a directory as default to play via a button without allowing users to choose a file?

The Liberty BASIC FILES statement will fill an array with all the MP3 files in a specified directory:

https://lbpe.wikispaces.com/UsingTheFilesStatement

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls