Re: Playing tone through speakers

From: Sam Watkins (swatkins_at_fastmail.fm)
Date: 01/20/05

  • Next message: Sam Watkins: "Re: bittorrent troubles was: Re: Sharing dfsbuild experiences."
    Date: Thu, 20 Jan 2005 23:22:21 +1100
    To: debian-user@lists.debian.org
    
    

    On Fri, Jan 14, 2005 at 01:19:20PM -0600, Michael Satterwhite wrote:
    > So the correct question would be: Does anyone know of a utility that
    > would play a continuous tone of a specified frequency through the
    > speakers attached to my SoundBlaster Live?

    Yes, I wrote one, it's called "bell". It's OSS specific at the moment,
    but I suppose it would work with ALSA's OSS emulation.

      http://nipl.net/hacks/

    It's written in my C dialect, which has a python-like syntax, and uses
    some libraries I wrote. Here is the source code:

      http://nipl.net/hacks/bell.b

    I wrote a program yesterday to automatically make standalone source
    files so I wouldn't have to burden you with my libraries. Here is the
    source code including the bits of my libraries it needs:

      http://nipl.net/hacks/bell.b1

    Here is the C translation, this is the one you'll need if you want to
    compile it yourself:

      http://nipl.net/hacks/bell.c

    And here is an i386/linux elf executable:

      http://nipl.net/hacks/bell

    To compile:

      gcc -Wall -lm bell.c

    Usage:

      bell <freq> <amplitude> <duration>

    Examples:

      bell 440 1 1
      
    gives an A440 tone at max volume for 1 second.

      bell 220 0.5 0.1

    gives an A220 tone (one octave lower) at half volume for 0.1 second.

    If you are musically inclined, you might want to do something like this
    to use semitones instead of hertz (beware, perl code):

    sub bell {
            my ($pitch, $duration, $volume) = @_;
            $volume = $ENV{bell_volume} if @_ == 2;
            my $freq = 440 * 2 ** ($pitch / 12);
            system("bell", $freq, $volume, $duration);
    }

    I should probably modify the bell program to do this itself.

    I wrote this bell program as part of my "voice editor", "ved", which is
    intended for blind people to record and edit speech, or for people to
    record audio-books, or for children who have trouble writing or typing
    to be able to record stories for school then write them down later.
    I found it was quite good for recording a diary too.

    It allows you to record your speech, automatically splits the recorded
    sound into sentences and omits stretches of silence. You can browse
    back and forth and change things, insert new recorded speech, etc., play
    back the recording at various speeds (using sox), structure your work
    into paragraphs and chapters and browse around a paragraph or chapter at
    a time, etc. I wrote it for my grandmother who cannot see very well.

    I intend to release "ved" as free-software, would anyone be interested
    in using it when I do?

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Sam Watkins: "Re: bittorrent troubles was: Re: Sharing dfsbuild experiences."

    Relevant Pages

    • Re: Obama in ALL his Humility
      ... Play it several times- in the middle of the speech you can distinctly ... Read this message backwards to hear the REAL message..... ... Dead OR Alive. ...
      (talk.politics.guns)
    • Re: OT question
      ... our final in Speech class was for a group debate ... believe playing a part compromises my ethics or values. ... the part if it were a lousy movie in general that I did not think would be ... requires you to play a doctor who performs abortions. ...
      (sci.med.transcription)
    • Re: OT A Perfect Example of Conservative Values
      ... to characterize the speech a few days after the fact. ... Humphrey Bogart never said "Play it again, Sam" in Casablanca. ...
      (rec.music.classical.recordings)
    • Re: OT question
      ... our final in Speech class was for a group debate ... believe playing a part compromises my ethics or values. ... You've been offered the lead part in a movie. ... requires you to play a doctor who performs abortions. ...
      (sci.med.transcription)
    • Re: Anybody code recreationally?
      ... people who play the Magic the Gathering card game. ... and that anyone could view the source code. ... All you can do is ignore him, after all most of this fun coding is for ...
      (microsoft.public.dotnet.languages.vb)