Announcement

Collapse
No announcement yet.

MP3 (or wav) in resource file?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MP3 (or wav) in resource file?

    I'm making up a little personalized Christmas card program for the retirement home where I live and I want it to play a little music. Getting it on their computer won't be too difficult if it's a single file but if I have a few files it'll take some serious schmoozing. The reasons for that are far too silly to explain.

    Anyway, with that in mind is there some way I can include a few MP3 files in the resource and compile them into the executable? If so, how?

    I can use wav files for this if I have to, or any other format that I can convert to, but they are MP3 and I have a routine that will play MP3 so I'd like to go ahead and use that if possible. If not, that's okay too.

    Any tips will be appreciated.

    Thanks,
    Barry

  • #2
    Check my (same) question at: http://www.powerbasic.com/support/pb...ad.php?t=21403
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      Originally posted by Mel Bishop View Post
      Thanks. That's all about wav files, which I can use if I have to, but MP3 would be smaller. I'm not sure how much that matters but if it's not a lot harder it might be better. Do you or anyone know of something comparable for MP3?

      Actually, I just converted one of the 5 songs I plan to put in it to wav and it went from 2.1 meg to 23 meg. That's still managable but it makes MP3 look a lot better.

      Barry

      Comment


      • #4
        You could use a resource file with RCDATA statements loading the MP3 files into your executable.
        Extract them temporarily to disk when it's time to play and 'Kill' them when done.

        There are plenty of examples using RCDATA in the forums.
        This one by William Burns is pretty straight-forward.. http://www.powerbasic.com/support/pb...ad.php?t=23527
        Rgds, Dave

        Comment


        • #5
          Thanks. I didn't know about RCDATA. I'll take a look at it. That might work out for me.

          Barry

          Comment


          • #6
            You can put ANYTHING in a program resource...

            User-Defined Resource Demo January 26 2003

            MCM
            Michael Mattias
            Tal Systems Inc. (retired)
            Racine WI USA
            [email protected]ms.com
            http://www.talsystems.com

            Comment


            • #7
              Thanks. That looks useful.

              Barry

              Comment


              • #8
                Michael's example rocks - try it-

                I've got a function that will play the wav's, not sure if it will mp3's but I'd be curious - won't have time until tomorrow to look at it...
                Scott Turchin
                MCSE, MCP+I
                http://www.tngbbs.com
                ----------------------
                True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

                Comment

                Working...
                X