Results 1 to 4 of 4

Thread: CD-ROM unit problems

  1. #1

    CD-ROM unit problems

    I am building an Audio CD player in TP 7, and i am using an old Unit that i found on a website, it works OK but there is a little bug, it can't play the first track from the CD. I don't know what is the problem, tried everything but it will not play the first track ops: can someone help me?

    Here is the link to the Unit:

    http://victim_of_bodom.t35.com/CDROM.PAS

    and 2 examples:
    [pascal]
    uses CDROM;
    Begin
    cd_play(1,cd_track_length(1));
    End. {playing the 1st track, NO sound, Nothing}
    [/pascal]

    [pascal]
    uses CDROM;
    Begin
    cd_play(2,cd_track_length(2));
    End. {plays the 2nd track, works OK}
    [/pascal]

  2. #2
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    CD-ROM unit problems

    First off, welcome to PGD!

    That said... wow! TP7 huh? :scratch:

    Curious, whats the platform your running this on?


    Not being the type to suggest one's current tools of choice away, but... you might want to have a look at Free Pascal as an alternative.

    It's 'Turbo Pascal' compatible as far as language specifics go, but it also supports Windows, Linux and Mac OS X natively. And I believe that older versions support DOS if you have a specific need for it.

    They even have a code repository for such units for things like CD-ROM playback.


    You'll find that not many people [size=9px](well noone anymore)[/size] use TP7 anymore as there are so many new compilers out there. Free Pascal, Delphi, Chrome, Lazarus, MIDletPascal, etc. Pascal has evolved.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  3. #3

    CD-ROM unit problems

    I know, but this is a school project and i am limited to turbo pascal.
    We use Free Pascal at school, but for this homework we are limited to Turbo Pascal 6 or 7 because our teacher is an "old-school programmer" :lol:

  4. #4
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    CD-ROM unit problems

    Hmm... just a thought... have you tried using 0 as the first parameter?

    Most arrays are 0-based. Meaning that the first element in that array is 0 not 1. So to cycle through it using a for loop you'd have to do the following:

    [pascal]for i := 0 to NumberOfItems - 1 do[/pascal]

    How does this help you? Well it might be possible that the CD tracks are indexed in such a manner. So your first track would be 0 and your second is 1 and so on.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •