• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

1stplugins

FileMaker plug-ins and Reverse Engineering

  • Plugins
    • MediaManager
  • Services
    • Reverse Engineering
    • FileMaker Plug-Ins
  • About
    • About Us
    • Contact Us
    • Terms of Use of the Website and Privacy Policy
  • Store
    • Terms and Conditions
    • Warranty Claim Guidelines
    • Contract Withdrawal Form
    • Warranty Claim Report

Media_DrawWaveform

Media_DrawWaveform ( container; trackID; width; height { ; startTime { ; endTime { ; fgcolor { ; bgcolor } } } } )

Media_DrawWaveform creates a waveform image of a sound file and places it into a container field. The image is generated in the colors and dimensions you specify. You can focus the waveform on a specific time segment of the audio file or cover its full length.

Parameter Description
container Sound location ( container field or file path )
trackID Track of the audio file to be graphed (typically “1”).
width Width of the waveform image to be generated (in pixels).
height Height of the waveform image to be generated (in pixels).
startTime Optional parameter. Time in sound file to begin graph (HH:MM:SS.S).
endTime Optional parameter. Time in sound file to end graph (HH:MM:SS.S).
fgcolor Optional parameter. Foreground color for the sound graph (in hexadecimal).
bgcolor Optional parameter. Background color for the sound graph (in hexadecimal).

The result must be returned to a container field.

The resulting image shows two waveform graphs, one above the other. The top waveform is for the left channel, the bottom is the right channel.

Graphing the Full Sound File

If you want to graph the entire sound file, set both the startTime and endTime parameters to “00:00:00”.

Use Media_GetLastError to get possible error of this function.

Examples

To create a waveform at 500×200 pixels for an audio file in a field named soundContainer:

Set Field [ MyTable::WaveFormImage ;
Media_DrawWaveform (
myTable::soundContainer ;
1 ;# track number
500 ;# 500 pixels wide
200 ;# 200 pixels tall
"00:00:00" ;# start
"00:00:00" ;# end
"#000000" ;# black waveform
"#FFFFFF"# white background
) ]

To get the same waveform for an audio file on the desktop named song.mp3:

Set Field [ MyTable::WaveFormImage ;
Media_DrawWaveform (
".D/song.mp3" ;
1 ;# track number
500 ; 200 ;# 500 x 200 pixels
"00:00:00" ;# start
"00:00:00" ;# end
"#000000" ;# black waveform
"#FFFFFF" # white background
) ]

To create a waveform graph covering the first 10 seconds of the sound file:

Set Field [ MyTable::WaveFormImage ;
Media_DrawWaveform (
".D/song.mp3" ;
1 ;# track number
500 ; 200 ;# 500 x 200 pixels
"00:00:00" ;# start
"00:00:10" ;# end
"#000000" ;# black waveform
"#FFFFFF" # white background
) ]

To generate a waveform with a green foreground and dark violet background:

Set Field [ MyTable::WaveFormImage ;
Media_DrawWaveform (
".D/song.mp3" ;
1 ;# track number
500 ; 200 ;# 500 x 200 pixels
"00:00:00" ;# start
"00:00:10" ;# end
"#00FF00" ;# green waveform
"#660099" # violet background
) ]

Primary Sidebar

Document Functions

Media_CopyItem
Media_CreateAlias
Media_CreateFolder
Media_DeleteItem
Media_ExportField
Media_ExtractInfo
Media_GetDefaultFolder
Media_GetItemInfo
Media_GetName
Media_GetPath
Media_InsertFile
Media_ListDisks
Media_ListFolder
Media_MoveItem
Media_OpenItem
Media_RenameItem
Media_Search
Media_SetDefaultFolder

General and Registration Functions

Media_Get
Media_GetLastError
Media_GetMouseUp
Media_JSONPath
Media_PeekStream
Media_Register
Media_RegisterLicensedEncoder
Media_Set
Media_Version

Image Functions

Media_ConvertImage
Media_CreateQRCode
Media_EffectApply
Media_EffectDialog
Media_GetImageInfo
Media_GetMetadata
Media_InsertImage
Media_ListImageOutputTypes
Media_SetImageDefaults Media_TApply
Media_TClear
Media_TCrop
Media_TQuad
Media_TResize
Media_TRotate
Media_TScale
Media_TSkew

Script Steps

Copy Item
Create Alias
Create Folder
Delete Item
Export Field
Get Default Folder
Get Item Property
Move Item
Open Item
Rename Item
Set Default Folder

Sound Functions

Media_Amplify
Media_AppendSound
Media_ConvertSound
Media_CreateSound
Media_DrawWaveform
Media_ExtractSound
Media_FadeSound
Media_GetMetadata
Media_GetSoundInfo
Media_InsertQuickTime
Media_ListSoundOutputFormats
Media_MixSounds
Media_Normalize
Media_PlayPause
Media_PlaySound
Media_RecordSoundFormatDialog
Media_RecordSoundStart
Media_RecordSoundPause
Media_RecordSoundStop
Media_SetMetadata
Media_SoundFormatDialog
Media_StopSound

Video Functions

Media_GetVideoInfo

Footer

Let’s get started on your project.

Get in touch

  • Plugins
  • Services
  • About
  • Store

Copyright ©2006-2020 by 1stplugins, s.r.o. All rights reserved.