locked
How to retrieve(and play) audio files from sqlite in c# application for windows 8

    Question

  • I have some mp3 files stored in sqlite database as BLOB. 
    I have to make a query from my c# application to retrieve 
    this BLOBs and make them play. I have been reading a lot 
    on manipulating BLOBs but every example is on Images. 

    Links I've read:

     http://stackoverflow.com/questions/20221786/retrieving-a-blob-with-system-data-sqlite-and- c-sharp

     http://www.devart.com/dotconnect/sqlite/docs/Devart.Data.SQLite~Devart.Data.SQLite.SQLiteBlob.html

     http://social.msdn.microsoft.com/Forums/windowsapps/en-US/03cf8ce8-815e-447c-8630-4faa2b07fc90/how-to-store-image-in-sqlite-database-using-xaml-and-c-codingwindows-8-apps?forum=winappswithcsharp

    Any suggestion please?

    • Edited by bdhimitri Saturday, February 22, 2014 8:46 PM
    Saturday, February 22, 2014 8:46 PM

Answers

  • Hi bdhimitri,

    Mp3 audio is a kind BLOB data. BLOB will save whatever you insert into the Database. The code should be as same as saving the image to SQLite.

    Is there any specific question that you don't know when saving the audio to SQLite?

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, February 24, 2014 6:18 AM
    Moderator
  • Hi ,

    The second link provides an example of what you want to do.  You don't care if it is a video , or an image or even a huge string. If you convert it to byte array and follow the example in the second link you should be OK.

    Did you try it and is not working ?

    thank you


    Monday, February 24, 2014 12:08 PM

All replies

  • Hi bdhimitri,

    Mp3 audio is a kind BLOB data. BLOB will save whatever you insert into the Database. The code should be as same as saving the image to SQLite.

    Is there any specific question that you don't know when saving the audio to SQLite?

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, February 24, 2014 6:18 AM
    Moderator
  • Hi ,

    The second link provides an example of what you want to do.  You don't care if it is a video , or an image or even a huge string. If you convert it to byte array and follow the example in the second link you should be OK.

    Did you try it and is not working ?

    thank you


    Monday, February 24, 2014 12:08 PM