Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. audio conversion

audio conversion

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
13 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    puneet_cha
    wrote on last edited by
    #1

    hi all i want to convert one audio format to another. for this i will have to get hold of digital o/p of audio data and than apply compression algorithms according to specification of various file formats. i wanted to ask how to get hold of that uncompressed digital data?

    M E 2 Replies Last reply
    0
    • P puneet_cha

      hi all i want to convert one audio format to another. for this i will have to get hold of digital o/p of audio data and than apply compression algorithms according to specification of various file formats. i wanted to ask how to get hold of that uncompressed digital data?

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      puneet_cha wrote:

      i wanted to ask how to get hold of that uncompressed digital data?

      Wouldn't you get that by uncompressing the source data?

      "If you can dodge a wrench, you can dodge a ball."

      1 Reply Last reply
      0
      • P puneet_cha

        hi all i want to convert one audio format to another. for this i will have to get hold of digital o/p of audio data and than apply compression algorithms according to specification of various file formats. i wanted to ask how to get hold of that uncompressed digital data?

        E Offline
        E Offline
        Eytukan
        wrote on last edited by
        #3

        From which format to which format?


        Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.

        P 1 Reply Last reply
        0
        • E Eytukan

          From which format to which format?


          Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.

          P Offline
          P Offline
          puneet_cha
          wrote on last edited by
          #4

          i have to mainly consider 2 formats MP3 and WAVE. but main issue is that how to get the digital data given by A/D converter. can somebody help me in this

          M 1 Reply Last reply
          0
          • P puneet_cha

            i have to mainly consider 2 formats MP3 and WAVE. but main issue is that how to get the digital data given by A/D converter. can somebody help me in this

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            Do you want raw PCM data? From what source?

            "If you can dodge a wrench, you can dodge a ball."

            P 1 Reply Last reply
            0
            • M Mark Salsbery

              Do you want raw PCM data? From what source?

              "If you can dodge a wrench, you can dodge a ball."

              P Offline
              P Offline
              puneet_cha
              wrote on last edited by
              #6

              YA I WANT A RAW PCM DATA. THE OUTPUT OF ANALOG TO DIGITAL CONVERTER

              M 1 Reply Last reply
              0
              • P puneet_cha

                YA I WANT A RAW PCM DATA. THE OUTPUT OF ANALOG TO DIGITAL CONVERTER

                M Offline
                M Offline
                Mark Salsbery
                wrote on last edited by
                #7

                That will depend on the device then. If it's a device that includes a driver of some kind to access the data then you can get it there. Otherwise you need to write a driver to access the hardware. If the device is a sound card, you can use DirectX or the Windows Multimedia APIs.

                "If you can dodge a wrench, you can dodge a ball."

                P 1 Reply Last reply
                0
                • M Mark Salsbery

                  That will depend on the device then. If it's a device that includes a driver of some kind to access the data then you can get it there. Otherwise you need to write a driver to access the hardware. If the device is a sound card, you can use DirectX or the Windows Multimedia APIs.

                  "If you can dodge a wrench, you can dodge a ball."

                  P Offline
                  P Offline
                  puneet_cha
                  wrote on last edited by
                  #8

                  will direct show API solve my purpose?

                  M 1 Reply Last reply
                  0
                  • P puneet_cha

                    will direct show API solve my purpose?

                    M Offline
                    M Offline
                    Mark Salsbery
                    wrote on last edited by
                    #9

                    You haven't yet indicated the source of the audio so I have no idea what your purpose is! :) If you need PCM data from a sound card then DirectX (DirectSound) is a solution. Windows multimedia audio is another soution.

                    "If you can dodge a wrench, you can dodge a ball."

                    P 1 Reply Last reply
                    0
                    • M Mark Salsbery

                      You haven't yet indicated the source of the audio so I have no idea what your purpose is! :) If you need PCM data from a sound card then DirectX (DirectSound) is a solution. Windows multimedia audio is another soution.

                      "If you can dodge a wrench, you can dodge a ball."

                      P Offline
                      P Offline
                      puneet_cha
                      wrote on last edited by
                      #10

                      hi mark my work is to convert MP3 file to WAv and vice versa. so to do that i need raw PCM data,on which i can perform operations for the above purpose. so i wanted to know how can i get that raw PCM data.

                      M 1 Reply Last reply
                      0
                      • P puneet_cha

                        hi mark my work is to convert MP3 file to WAv and vice versa. so to do that i need raw PCM data,on which i can perform operations for the above purpose. so i wanted to know how can i get that raw PCM data.

                        M Offline
                        M Offline
                        Mark Salsbery
                        wrote on last edited by
                        #11

                        That's what I thought from your first post, which is why I first replied that way. DirectX is for accessing devices so it's not really applicable for file conversion. Generally, you read audio data, transform the data to a new format, and write the resulting data. To convert MP3 to WAV you'd read from the MP3 file, decompress the audio samples to PCM, and write them to the a WAV file. To convert WAV to MP3 you'd read from the WAV file, compress the audio samples to using MP3 compression, and write the resulting compressed data to the a MP3 file. You can learn the MP3 format and compression algorithm and write your own codec. You'd also need to understand the format of the files (MP3 and WAV). If you don't want to write your own transformation code then the Audio Compression Manager[^] included with Windows can help do it for you. You need to supply an MP3 encoder (Windows doesn't include one) but there is a free one called LAME[^] that's popular.

                        "If you can dodge a wrench, you can dodge a ball."

                        P 1 Reply Last reply
                        0
                        • M Mark Salsbery

                          That's what I thought from your first post, which is why I first replied that way. DirectX is for accessing devices so it's not really applicable for file conversion. Generally, you read audio data, transform the data to a new format, and write the resulting data. To convert MP3 to WAV you'd read from the MP3 file, decompress the audio samples to PCM, and write them to the a WAV file. To convert WAV to MP3 you'd read from the WAV file, compress the audio samples to using MP3 compression, and write the resulting compressed data to the a MP3 file. You can learn the MP3 format and compression algorithm and write your own codec. You'd also need to understand the format of the files (MP3 and WAV). If you don't want to write your own transformation code then the Audio Compression Manager[^] included with Windows can help do it for you. You need to supply an MP3 encoder (Windows doesn't include one) but there is a free one called LAME[^] that's popular.

                          "If you can dodge a wrench, you can dodge a ball."

                          P Offline
                          P Offline
                          puneet_cha
                          wrote on last edited by
                          #12

                          hi mark u wrote "To convert MP3 to WAV you'd read from the MP3 file, decompress the audio samples to PCM, and write them to the a WAV file." I wanted to know:- HOW CAN I DECOMPRESS THE AUDIO SAMPLES TO PCM?is there any API for this?

                          M 1 Reply Last reply
                          0
                          • P puneet_cha

                            hi mark u wrote "To convert MP3 to WAV you'd read from the MP3 file, decompress the audio samples to PCM, and write them to the a WAV file." I wanted to know:- HOW CAN I DECOMPRESS THE AUDIO SAMPLES TO PCM?is there any API for this?

                            M Offline
                            M Offline
                            Mark Salsbery
                            wrote on last edited by
                            #13

                            The same APIs can do it but you still need an MP3 codec (the "dec"oder part of "codec") or you'd need to write your own. The APIs are available with the OS but the codec is not due to MPEG-3 licensing restrictions. Mark

                            "If you can dodge a wrench, you can dodge a ball."

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups