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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Convert WAV file to text string and back

Convert WAV file to text string and back

Scheduled Pinned Locked Moved C / C++ / MFC
databasecsharpmysqltutorialquestion
3 Posts 3 Posters 4 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.
  • R Offline
    R Offline
    Rolando Cruz
    wrote on last edited by
    #1

    My question is simple enough. I need to convert WAV files into a text string, store the string into a database table (mySQL) and when needed convert the text back and rebuild the WAV file for playback. I have looked into using the LongBlob and read many messages (here and other sites) on how to handle the longblog's but it seems to me there are no adecuate solutions since I am using straight SQL statements with ODBC and not ADO or .NET or any else for that matter. I already convert and store a each byte of the WAV file into a HEX representation and store tehem into multiple table records. What I now need to do is the oposite; convert the text strings back and rebuild the WAV file. For the life in me, I can't figure it out! :zzz: Maybe I'm just tired or something. :zzz: I'm sure it is something simple to acomplish. Any suggestions would be appreciated. Thanks.

    Rolando :suss:

    CPalliniC M 2 Replies Last reply
    0
    • R Rolando Cruz

      My question is simple enough. I need to convert WAV files into a text string, store the string into a database table (mySQL) and when needed convert the text back and rebuild the WAV file for playback. I have looked into using the LongBlob and read many messages (here and other sites) on how to handle the longblog's but it seems to me there are no adecuate solutions since I am using straight SQL statements with ODBC and not ADO or .NET or any else for that matter. I already convert and store a each byte of the WAV file into a HEX representation and store tehem into multiple table records. What I now need to do is the oposite; convert the text strings back and rebuild the WAV file. For the life in me, I can't figure it out! :zzz: Maybe I'm just tired or something. :zzz: I'm sure it is something simple to acomplish. Any suggestions would be appreciated. Thanks.

      Rolando :suss:

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      It seems simple, in principle: ou have just to reconvert back each byte (two hexadecima digits) of your multiple records and chain them in a single binary file. What are you afraid about? :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      In testa che avete, signor di Ceprano?

      1 Reply Last reply
      0
      • R Rolando Cruz

        My question is simple enough. I need to convert WAV files into a text string, store the string into a database table (mySQL) and when needed convert the text back and rebuild the WAV file for playback. I have looked into using the LongBlob and read many messages (here and other sites) on how to handle the longblog's but it seems to me there are no adecuate solutions since I am using straight SQL statements with ODBC and not ADO or .NET or any else for that matter. I already convert and store a each byte of the WAV file into a HEX representation and store tehem into multiple table records. What I now need to do is the oposite; convert the text strings back and rebuild the WAV file. For the life in me, I can't figure it out! :zzz: Maybe I'm just tired or something. :zzz: I'm sure it is something simple to acomplish. Any suggestions would be appreciated. Thanks.

        Rolando :suss:

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

        You're using ODBC directly? If so, it's fairly easy to do reading/writing of BLOB fields. These are the only functions needed I believe, most of which you're probably already using if you're using ODBC: SQLAllocHandle() (optional) SQLSetStmtAttr() to set synchronous/asynchronous and other statement attributes (optional) SQLBindParameter() depending on the query SQLExecDirect() SQLFetch() SQLGetData() / SQLPutData() (optional) SQLParamData() depending on the query SQLFreeHandle() Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        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