play_sound(7) won't turn off! - LUA Scripting - CHDK Forum

play_sound(7) won't turn off!

  • 10 Replies
  • 5103 Views
play_sound(7) won't turn off!
« on: 24 / June / 2012, 15:23:04 »
Advertisements
The wiki says that a half-shutter press will turn it off, so I tried this:
Code: [Select]
play_sound(7)
sleep(500)
press("shoot_half")
release("shoot_half")

I had to turn the camera off in order to stop the sound.  How would I get this to work?

PS: It hurts my ears 0_0

Re: play_sound(7) won't turn off!
« Reply #1 on: 24 / June / 2012, 15:50:23 »
What if you do play_sound(0) instead of  press("shoot_half") ?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: play_sound(7) won't turn off!
« Reply #2 on: 24 / June / 2012, 16:05:19 »
Try putting a sleep between press and release.

Re: play_sound(7) won't turn off!
« Reply #3 on: 24 / June / 2012, 16:11:18 »
Neither of those works.  The camera is muted, if that makes any difference.


*

Offline srsa_4c

  • ******
  • 4451
Re: play_sound(7) won't turn off!
« Reply #4 on: 24 / June / 2012, 16:20:09 »
Some documentation from the source (platform/generic/wrappers.c)
Code: [Select]
void play_sound(unsigned sound)
{
static const int sounds[]={ 0x2001, //startup sound
                                0x2002, //shutter sound
                                0x2003, //button press sound
                                0x2004, //self-timer sound
                                0xC211, //short beep
                                50000,  // AF confirmation
                                0xC507, // error beep imo
                                0x400D, // LONG ERROR BEEP CONTINIUOUS- warning, cannot be stopped (yet)
                            };
    if(sound >= sizeof(sounds)/sizeof(sounds[0]))
        return;

    _PT_PlaySound(sounds[sound], 0);
}
7 happens to be the "long error beep"

*

Offline reyalp

  • ******
  • 14079
Re: play_sound(7) won't turn off!
« Reply #5 on: 24 / June / 2012, 16:36:30 »
The wiki says that a half-shutter press will turn it off, so I tried this:
Code: [Select]
play_sound(7)
sleep(500)
press("shoot_half")
release("shoot_half")

I had to turn the camera off in order to stop the sound.  How would I get this to work?
play_sound just calls a canon firmware function.

On my a540, the "half press to stop" only works if the camera is not muted, in a still shooting mode and half_press is pressed for long enough to actually do the full pre-shoot cycle.

caveat h:
If it doesn't behave as documented on the wiki, then either your camera is different, or the documentation is wrong or incomplete, you are doing it wrong, or some combination of these.
Don't forget what the H stands for.

Re: play_sound(7) won't turn off!
« Reply #6 on: 24 / June / 2012, 16:48:37 »
It works with mute turned off, but how would I get rid of sound7 beeping when the camera focuses?  I want to make the act of taking a picture silent except for the mechanical stuff.  My camera is an SD1100 btw.

*

Offline reyalp

  • ******
  • 14079
Re: play_sound(7) won't turn off!
« Reply #7 on: 24 / June / 2012, 16:55:01 »
It works with mute turned off, but how would I get rid of sound7 beeping when the camera focuses?
I don't understand, you just said pressing half_press works if mute is off  ???

Quote
I want to make the act of taking a picture silent except for the mechanical stuff.  My camera is an SD1100 btw.
The Canon firmware should have volume controls for all the different sounds (except #7).
Don't forget what the H stands for.


Re: play_sound(7) won't turn off!
« Reply #8 on: 24 / June / 2012, 17:22:59 »
Quote
The Canon firmware should have volume controls for all the different sounds (except #7).

When I press the shoot button half way, something like sound #7 beeps momentarily, a green box appears, and the camera is focused.  This happens even with all of the volume controls off.  When I mute the camera this sound doesn't play, but I can't control the turning off of sound #7 in a script.  Thats what I meant, sorry if I wasn't clear  ;).  Is there some way to let me turn off this beep while keeping the camera unmuted?

*

Offline reyalp

  • ******
  • 14079
Re: play_sound(7) won't turn off!
« Reply #9 on: 24 / June / 2012, 17:34:00 »
Is there some way to let me turn off this beep while keeping the camera unmuted?
Per caveat h above, the exact behavior is not well defined, and may vary between cameras. Your mission, should you choose to accept it, is to perform experiments to clarify the behavior on your camera and report the results here.
Don't forget what the H stands for.

 

Related Topics