Documentation ¶
Overview ¶
复制自 https://dev.to/ik5/quick-and-dirty-audio-playing-in-golang-3n7c 功能上微调 只适用于 windows
Index ¶
Constants ¶
View Source
const ( SND_SYNC uint = 0x0000 /* play synchronously (default) */ SND_ASYNC uint = 0x0001 /* play asynchronously */ SND_NODEFAULT uint = 0x0002 /* silence (!default) if sound not found */ SND_MEMORY uint = 0x0004 /* pszSound points to a memory file */ SND_LOOP uint = 0x0008 /* loop the sound until next sndPlaySound */ SND_NOSTOP uint = 0x0010 /* don't stop any currently playing sound */ SND_NOWAIT uint = 0x00002000 /* don't wait if the driver is busy */ SND_ALIAS uint = 0x00010000 /* name is a registry alias */ SND_ALIAS_ID uint = 0x00110000 /* alias is a predefined ID */ SND_FILENAME uint = 0x00020000 /* name is file name */ SND_RESOURCE uint = 0x00040004 /* name is resource name or atom */ SND_PURGE uint = 0x0040 /* purge non-static events for task */ SND_APPLICATION uint = 0x0080 /* look for application specific association */ SND_SENTRY uint = 0x00080000 /* Generate a SoundSentry event with this sound */ SND_RING uint = 0x00100000 /* Treat this as a "ring" from a communications app - don't duck me */ SND_SYSTEM uint = 0x00200000 /* Treat this as a system sound */ SND_ALIAS_START uint = 0 /* alias base */ )
Variables ¶
This section is empty.
Functions ¶
func QrCodeBase64 ¶
func TestSndPlaySoundW ¶
func TestSndPlaySoundW()
Types ¶
type TTS ¶
type TTS struct {
// contains filtered or unexported fields
}
func (*TTS) RemoveTempFile ¶
func (self *TTS) RemoveTempFile()
删除临时文件,要手动执行,在 SayNoWait 和 SayWait 中之行的话会在 windows 执行朗读之前删掉,导致不能朗读
type WinSound ¶
type WinSound struct {
// contains filtered or unexported fields
}
func (*WinSound) SndPlaySoundA ¶
SndPlaySoundA play sound file in Windows
func (*WinSound) SndPlaySoundW ¶
SndPlaySoundW play sound file in Windows
Click to show internal directories.
Click to hide internal directories.