Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
go-cqhttp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
go-cqhttp
Commits
9af61a33
Commit
9af61a33
authored
Aug 13, 2020
by
Arnie97
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support silk audio
parent
774a1e32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
global/fs.go
global/fs.go
+11
-9
No files found.
global/fs.go
View file @
9af61a33
package
global
import
(
log
"github.com/sirupsen/logru
s"
"byte
s"
"io/ioutil"
"os"
"path"
)
var
IMAGE_PATH
=
path
.
Join
(
"data"
,
"images"
)
log
"github.com/sirupsen/logrus"
)
var
VOICE_PATH
=
path
.
Join
(
"data"
,
"voices"
)
var
(
IMAGE_PATH
=
path
.
Join
(
"data"
,
"images"
)
VOICE_PATH
=
path
.
Join
(
"data"
,
"voices"
)
VIDEO_PATH
=
path
.
Join
(
"data"
,
"videos"
)
var
VIDEO_PATH
=
path
.
Join
(
"data"
,
"videos"
)
HEADER_AMR
=
[]
byte
(
"#!AMR"
)
HEADER_SILK
=
[]
byte
(
"
\x02
#!SILK_V3"
)
)
func
PathExists
(
path
string
)
bool
{
_
,
err
:=
os
.
Stat
(
path
)
...
...
@@ -37,8 +42,5 @@ func Check(err error) {
}
func
IsAMR
(
b
[]
byte
)
bool
{
if
len
(
b
)
<=
6
{
return
false
}
return
b
[
0
]
==
0x23
&&
b
[
1
]
==
0x21
&&
b
[
2
]
==
0x41
&&
b
[
3
]
==
0x4D
&&
b
[
4
]
==
0x52
// amr file header
return
bytes
.
HasPrefix
(
b
,
HEADER_AMR
)
||
bytes
.
HasPrefix
(
b
,
HEADER_SILK
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment