Announcement

Collapse
No announcement yet.

How to suspend audio recording capability?

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

  • How to suspend audio recording capability?

    I am developing a program that requires me to suspend audio recording capabilities while the program is running. What is the best way of accomplishing that?

    Thanks,

    Peter Redei

  • #2
    msgbox "Please don't record"

    or you could maybe switch the input channel to midi or some other channel the app doesn't play sound on while the app is running and maybe every few seconds. Personally I'd be pretty ticked if an app did this though. That is why I no longer buy Cyberlink products. I had their Power Director 5 and it was like Pro or some name they called it then which made it their top of the line. It had bugs though...one of which was everytime it started it turned on the mic output, so the mic audio came out the speakers and made the standard mic squeal noise until it almost blew my speakers. I'd go in and manually turn it off only to have it do it again at some point in running and again on close. They told me it would be fixed, but instead they came out with some new special edition of 5 and wanted me to pay $40 to upgrade to it after I just bought it the month before. I then bought Sony Vegas...even though I hate apps using .NET and have been using and upgrading to new versions of it since. So, the lesson from this- Don't mess with people's audio without permission or you lose sales...
    sigpic
    Mobile Solutions
    Sys Analyst and Development

    Comment


    • #3
      Might be some help to follow the various links in this article.
      http://www.borg.com/~jglatt/tech/winapi.htm
      Rick Angell

      Comment


      • #4
        Well, thanks for your help. I thought this is a common problem and it must have a solution. It might have by muting all inlines and checking with a timer if another program set it back. At the moment I cannot think of any better way. By the way this is not for a program I am selling. I really don't care if the user likes it or not. This is to prevent recording illegal copies while the music is played. Of course there is nothing to prevent from recording by a microphone from another computer, but in this case the quality will worsen.

        Peter Redei

        Comment


        • #5
          I believe a lot of audio cards that are designed for high-quality audio recording/playback (you know you have one of those if there are 1st party ASIO drivers provided with the card), use their own API to select recording inputs, which are often a lot more sophisticated than the standard Windows API.

          I believe, but am not 100% sure, my E-mu 0404 PCI audio card is an example of a card that does not listen to the standard Windows mixer settings. And this card can record its own output digitally, which should result in a recording that is of a decent quality (I guess recording compressed music would result in a little bit lower quality, but I don't think most us will hear the difference, especially since the source was already compressed anyway)

          If you are interested I'd be willing to test your program on my computer that I use to make music. I've bought PowerBASIC for Windows one week ago
          Last edited by Vincent van der Leun; 11 Jan 2008, 10:06 AM.

          Comment


          • #6
            Originally posted by Peter Redei View Post
            Of course there is nothing to prevent from recording by a microphone from another computer, but in this case the quality will worsen.
            A recording can also be made trough the S/PDIF audio-out; and that would be a digital, bit perfect (saving from audio cards that resample from 44.1 to 48KHz) copy.

            Bye!
            -- The universe tends toward maximum irony. Don't push it.

            File Extension Seeker - Metasearch engine for file extensions / file types
            Online TrID file identifier | TrIDLib - Identify thousands of file formats

            Comment


            • #7
              You must hook on the MM_WIM_DATA message, however you will have a hard time with VISTA, because the audio API has been totaly reworked.

              ...
              Patrice Terrier
              www.zapsolution.com
              www.objreader.com
              Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

              Comment


              • #8
                No matter what you do, if it can be played, it can be recorded. Anything trying to prevent it will only tick off real users. What type of audio is this playing anyway? Just standard files? If so, why would they choose to play with your player instead of the many other ones. The only advantage I see to this would be in a controlled environment like schools or something to keep kids from goofing off and copying music. But, there are always ways around it...trust me I know, I taught PreK-12 Computers. Your research in security compared to 300+ kids finding ways to break it...who do you think will win. And, if you do completely lock down everything like I ended up doing, then they start breaking hardware and complain to their parents saying they aren't learning anything...when really they are learning more, they just aren't learning the hacking skills they want. I actually had parents come in and tell me that MS Word was useless, and DOS was useless, and Using Windows was useless. These are probably the same people that as kids thought math was useless...
                sigpic
                Mobile Solutions
                Sys Analyst and Development

                Comment


                • #9
                  Thanks for all.
                  Yes, this is a kind of fight with no end, just like real wars. Here is the skeleton of the project: the player itself is distributed as a self_executable containing the music files encrypted. You do not write unencrypted files, just play the data from stream upon entering the correct password. But, how to prevent recording? In Windows operating system no matter what kind of hardware is used it has to provide a driver and end up with the windows operating system handling (at least that what I think). So, I am concentrating to the operating system and not to the various types of boards. It must be a way to block recording if the operating system knows how to record using any hardware.

                  Peter Redei

                  Comment


                  • #10
                    In order to grab the sound from a playing multiplex soundcard you must switch it to the "stereo" or "what you hear" or "wave out" mode, then you can use the "WINMM.DLL" API to record anything being played on the host computer CD-Audio, Mpeg or DivX movie, streamed internet audio, etc.

                    Then you use the mmioWrite API to write the wave buffer to disk while processing the %MM_WIN_DATA message.

                    Thus as i said already, one solution could be to hook the MM_WIN_DATA message or use "trampoline" to fool Windows, or to create a timer into your application that would switch off the "stereo" or "what you hear" or "wave out" mode.

                    Good luck

                    ...
                    Last edited by Patrice Terrier; 12 Jan 2008, 05:34 AM.
                    Patrice Terrier
                    www.zapsolution.com
                    www.objreader.com
                    Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

                    Comment


                    • #11
                      Patrice, I think your idea should work. As I recall the %MM_WIN_DATA message goes only to the application window that originated the recording. Since, this is not my application do I need to enumerate all windows, subclass each of them and monitor for %MM_WIN_DATA? It seems to me a very insufficient way... When you said trap the %MM_WIN_DATA you probably meant using SetWinEventHook? Do you know if SetWinEventHook is unchanged in Vista? Is %MM_WIN_DATA fired in Vista? I will play a little bit with the idea...

                      Thanks,

                      Peter Redei

                      Comment


                      • #12
                        Yes %MM_WIN_DATA is fired in Vista.

                        I think that you must use a global hook message to filter it.
                        Patrice Terrier
                        www.zapsolution.com
                        www.objreader.com
                        Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

                        Comment

                        Working...
                        X