IHTMLBGsound

IHTMLBGsound


This interface provides the methods for controlling background sound elements. These methods include the src, volume, balance, and loop properties for the sound element.

The BGSOUND tag enables you to create pages with background sounds or "sound tracks".

This element can be used only within the HEAD tag.

IHTMLBGsound Methods
get_balance   get_loop   get_src  
get_volume   put_balance   put_loop  
put_src   put_volume

IHTMLBGsound::get_balance

HRESULT get_balance(
    VARIANT *p
);

Retrieves the balance value of the background sound. The value specifies how the sound is divided between left and right speakers.

p
Address of a VARIANT structure that contains the balance.

See also put_balance

IHTMLBGsound::get_loop

HRESULT get_loop(
    VARIANT *p
);

Retrieves the number of times the sound will loop when activated.

p
VARIANT structure containing a numeric value that specifies the number of times to loop. If this parameter receives -1 (infinite), the video will loop continuously.

Following are descriptions on how the loop works for some boundary cases.
<BGSOUND src="file:///c:\win95\system\msremind.wav"> once
<BGSOUND src="file:///c:\win95\system\msremind.wav" LOOP> once
<BGSOUND src="file:///c:\win95\system\msremind.wav" LOOP=> zero times
<BGSOUND src="file:///c:\win95\system\msremind.wav" LOOP=-1> infinitely
<BGSOUND src="file:///c:\win95\system\msremind.wav" LOOP=0> once

See also put_loop

IHTMLBGsound::get_src

HRESULT get_src(
    BSTR *p
);

Retrieves the URL of the sound to be played.

p
Address of a string variable that receives the URL.

See also put_src

IHTMLBGsound::get_volume

HRESULT get_volume(
    VARIANT *p
);

Retrieves the volume setting for the sound. The higher the setting, the louder the sound.

p
Address of a VARIANT structure that receives the volume setting.

See also put_volume

IHTMLBGsound::put_balance

HRESULT put_balance(
    VARIANT v
);

Sets the balance value of the background sound. The value specifies how the sound is divided between left and right speakers.

v
VARIANT structure that contains the balance value to set.

See also get_balance

IHTMLBGsound::put_loop

HRESULT put_loop(
    VARIANT v
);

Sets the number of times the sound will loop when activated.

v
VARIANT structure containing the value that specifies the number of times to loop. If this parameter is -1 (infinite), the sound will loop continuously.

Following are descriptions on how loop works for some boundary cases.
<BGSOUND src="file:///c:\win95\system\msremind.wav"> once
<BGSOUND src="file:///c:\win95\system\msremind.wav" LOOP> once
<BGSOUND src="file:///c:\win95\system\msremind.wav" LOOP=> zero times
<BGSOUND src="file:///c:\win95\system\msremind.wav" LOOP=-1> infinitely
<BGSOUND src="file:///c:\win95\system\msremind.wav" LOOP=0> once

See also get_loop

IHTMLBGsound::put_src

HRESULT put_src(
    BSTR v
);

Sets the URL of a sound to be played.

v
String value that specifies the URL.

See also get_src

IHTMLBGsound::put_volume

HRESULT put_volume(
    VARIANT v
);

Sets the volume setting for the sound. The higher the setting, the louder the sound.

v
VARIANT structure that contains a string or numeric value specifying the volume setting.

See also get_volume

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.