Inserting audio data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arunbalait
    New Member
    • Feb 2007
    • 164

    #1

    Inserting audio data

    Help me how to insert audio or wave files into sql server database and what data type do i have to use..?

    Give me samples.....

    And also I want to know how to retrieve them?


    Thanx.......... .
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    I would save full path to wave files not files themselves.
    Retrieve full path from the database and go to the file and retrieve it.

    Good Luck.

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by iburyak
      I would save full path to wave files not files themselves.
      Retrieve full path from the database and go to the file and retrieve it.
      For another option, have a look at the Tips & Tricks thread, at the top of the VB forum. Among other things, it includes instructions on how to store and retrieve images in a BLOB (Binary Large Object) field. Should also work for sound files. You can also use an OLE field.

      Note, this relates to Access - I'm not sure how closely SQL Server resembles it.

      Comment

      • arunbalait
        New Member
        • Feb 2007
        • 164

        #4
        Ya thanx.. But I know how to store in Access but I need it in SQL Server...

        What data type do i have to use?

        I used OLE object datatype for Access but what for sql server?

        Comment

        • MMcCarthy
          Recognized Expert MVP
          • Aug 2006
          • 14387

          #5
          Originally posted by arunbalait
          Ya thanx.. But I know how to store in Access but I need it in SQL Server...

          What data type do i have to use?

          I used OLE object datatype for Access but what for sql server?
          All Access is doing is storing the path to a linked file or the full file if it's embedded. Storing embedded files is not recommended. In Access it is the OLE Object properties that determine how access treats this file and what application it uses to open it. As far as I'm aware this is not a feature of SQL Server.

          Mary

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by mmccarthy
            All Access is doing is storing the path to a linked file or the full file if it's embedded. Storing embedded files is not recommended. In Access it is the OLE Object properties that determine how access treats this file and what application it uses to open it. As far as I'm aware this is not a feature of SQL Server.
            Thanks, Mary.

            Presumably SQL Server has an equivalent to BLOBs, though? Arunbalait might need to go to simply storing the audio as a chunk of data and dumping it into a temp file to play it, much like the image thing I referred to earlier. Seems crude, but may be unavoidable.

            Comment

            • MMcCarthy
              Recognized Expert MVP
              • Aug 2006
              • 14387

              #7
              Originally posted by Killer42
              Thanks, Mary.

              Presumably SQL Server has an equivalent to BLOBs, though? Arunbalait might need to go to simply storing the audio as a chunk of data and dumping it into a temp file to play it, much like the image thing I referred to earlier. Seems crude, but may be unavoidable.
              I know BLOB's are used for image files so there is probably a way of doing it for audio files also. Unfortunately, not my area of expertise. I have asked someone else to have a look at this who may have more experience in this area.

              Mary

              Comment

              • arunbalait
                New Member
                • Feb 2007
                • 164

                #8
                Ya me too heard abut BLOB. But I want exact syntax for using BLOB...

                Give me an example like
                insert into tab1 values(?,?)
                to insert audio data....

                Also for creating table regarding this..


                give me exact sample code plz...

                thanx

                Comment

                • arunbalait
                  New Member
                  • Feb 2007
                  • 164

                  #9
                  I already got answer to store the audio data into Access. Its simply like storing image files using OLE object type. But I want to know about SQL Server. What datatype to use, how to insert etc., In access we can give the path to store. I used the same procedure in SQL but its not working...

                  I used varbinary data type in sql server

                  Comment

                  • arunbalait
                    New Member
                    • Feb 2007
                    • 164

                    #10
                    Finally I got the answer... I used image datatype in sql server to store wav files..

                    Thanx for u all...

                    Then anybody know abut .dss extension audio files?

                    Thank you

                    Comment

                    • NeoPa
                      Recognized Expert Moderator MVP
                      • Oct 2006
                      • 32669

                      #11
                      Originally posted by arunbalait
                      Then anybody know abut .dss extension audio files?
                      You should really ask this question in another thread.
                      That makes it easier to manage things and more people will look at a new thread than jump into another thread that is already started.

                      Comment

                      Working...