Decoder.GetAudioExt() return extension with .

pull/23/head
Emmm Monster 4 years ago
parent 9caf11217b
commit f9686bbfc4
No known key found for this signature in database
GPG Key ID: C98279C83FB50DB9

@ -27,7 +27,7 @@ func (d RawDecoder) GetAudioData() []byte {
}
func (d RawDecoder) GetAudioExt() string {
return d.audioExt
return "." + d.audioExt
}
func (d RawDecoder) GetMeta() Meta {

@ -40,7 +40,7 @@ func (d *Decoder) GetAudioData() []byte {
}
func (d *Decoder) GetAudioExt() string {
return d.outputExt
return "." + d.outputExt
}
func (d *Decoder) GetMeta() common.Meta {

@ -201,7 +201,9 @@ func (d *Decoder) Decode() error {
func (d Decoder) GetAudioExt() string {
if d.meta != nil {
return d.meta.GetFormat()
if format := d.meta.GetFormat(); format != "" {
return "." + d.meta.GetFormat()
}
}
return ""
}

@ -84,7 +84,10 @@ func (d Decoder) GetAudioData() []byte {
}
func (d Decoder) GetAudioExt() string {
return d.audioExt
if d.audioExt != "" {
return "." + d.audioExt
}
return ""
}
func (d Decoder) GetMeta() common.Meta {

@ -25,7 +25,10 @@ func (d *Decoder) GetAudioData() []byte {
}
func (d *Decoder) GetAudioExt() string {
return d.audioExt
if d.audioExt != "" {
return "." + d.audioExt
}
return ""
}
func (d *Decoder) GetMeta() common.Meta {

@ -38,7 +38,11 @@ func (d *Decoder) GetAudioData() []byte {
}
func (d *Decoder) GetAudioExt() string {
return d.outputExt
if d.outputExt != "" {
return "." + d.outputExt
}
return ""
}
func (d *Decoder) GetMeta() common.Meta {

@ -119,7 +119,7 @@ func tryDecFile(inputFile string, outputDir string, allDec []common.NewDecoderFu
outExt := dec.GetAudioExt()
if outExt == "" {
outExt = "mp3"
outExt = ".mp3"
}
filenameOnly := strings.TrimSuffix(filepath.Base(inputFile), filepath.Ext(inputFile))

Loading…
Cancel
Save