Sign in to follow this  
Followers 0
crashdemons

Sound UDF Documentation

2 posts in this topic

#1 ·  Posted (edited)

I just downloaded the SFX for AutoIt v3.3.0.0

I was wondering - is the UDF help file still actively updated in the SFX copy or has the Sound UDF documentation just not been updated?

autoit-v3-sfx.exe => UDFs3.chm

Function Reference

_SoundOpen

...

Return Value

Success: Sound ID

Failure: 0

...

This is exactly as shown in earlier autoit versions, however - _SoundOpen does NOT return a Sound ID (previously "Sound ID" meant the textual ID returned by the function) in the new release, but instead returns an array.

Am I missing some documentation here?

(UDFs3.chm seems to be feeding me some old info, which is quite confusing when updating my scripts...)

Additionally, the help file implies that _SoundPlay will accept an alias string, which does not seem to be the case.

SoundPlay

Play a sound file.

...

_SoundPlay ( $sSnd_id [, $fWait ] )

Parameters

$sSnd_id Sound ID (the 'alias') as returned by _SoundOpen or a file

...

(The above clearly implies a String input, not an array for _SoundPlay ($sSnd_id) )

Thanks in any event.

From Sound.au3

$aSndID[0] = $sSndID
        ...
    $aSndID[1] = $iVBRRatio
    $aSndID[2] = 0

    Return SetError(0, $iRet, $aSndID)

From OLDER Sound.au3

If $sAlias = "" Then
        $sSnd_id = RandomStr(10)
    Else
        $sSnd_id = $sAlias
    EndIf
    ...
    Return SetError(0, $iRet, $sSnd_id)
Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

crashdemons,

RazerM modified the Sound.au3 code last year, based on some work I did, to get over the problem of the MCI DLL returning incorrect durations from _SoundLen when dealing with VBR files. You can find out more about it here and here if you are interested.

Essentially, _SoundOpen now returns an array in which the [0] element is the alias string (as was the case before) and the [1] and [2] elements hold corrective factors for subsequent _SoundLen calls (these factors are also used in _SoundPos and _SoundSeek, for example). From a user's point of view there is no code breaking problem - the return array from _SoundOpen is used just as the 'old' string value.

I had not realised that the Help file had not been updated along with the UDF - I will raise a ticket and offer to help with the rewrite. Thanks for noticing. :-)

M23

Edit: Ticket raised.

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0