{"id":15470941,"url":"https://github.com/chekun/baidu-yuyin","last_synced_at":"2025-04-22T12:42:26.649Z","repository":{"id":57568204,"uuid":"93460111","full_name":"chekun/baidu-yuyin","owner":"chekun","description":"百度语音识别SDK for Go","archived":false,"fork":false,"pushed_at":"2017-06-06T05:59:34.000Z","size":4,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T01:13:34.336Z","etag":null,"topics":["baidu-yuyin-sdk","baiduyuyin"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chekun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-06T00:50:01.000Z","updated_at":"2023-02-28T08:16:18.000Z","dependencies_parsed_at":"2022-08-28T07:42:12.792Z","dependency_job_id":null,"html_url":"https://github.com/chekun/baidu-yuyin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekun%2Fbaidu-yuyin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekun%2Fbaidu-yuyin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekun%2Fbaidu-yuyin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekun%2Fbaidu-yuyin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chekun","download_url":"https://codeload.github.com/chekun/baidu-yuyin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250242853,"owners_count":21398210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baidu-yuyin-sdk","baiduyuyin"],"created_at":"2024-10-02T02:08:00.505Z","updated_at":"2025-04-22T12:42:26.622Z","avatar_url":"https://github.com/chekun.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"百度语音识别SDK for Go\n===============================\n\n第一个可用版本，随心使用，注意安全 😄\n\n## 安装\n\n```\ngo get -u github.com/chekun/baidu-yuyin\n```\n\n## 使用方法：\n\n```go\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/chekun/baidu-yuyin/asr\"\n\t\"github.com/chekun/baidu-yuyin/oauth\"\n)\n\nclientID := \"your-client-id\"\nclientSecret := \"your-client-secret\"\n\nauth := oauth.New(clientID, clientSecret, oauth.NewMemoryCacheMan())\n//一次性使用也可以不缓存token, 如下\n//auth := oauth.New(clientID, clientSecret, nil)\n//也可以实现自己的缓存，往下看⬇️ ️ ️\ntoken, err := auth.GetToken()\nif err != nil {\n    panic(err)\n}\n\nfile, err := os.Open(\"speech.wav\")\nif err != nil {\n    panic(err)\n}\ndefer file.Close()\nfmt.Println(asr.ToText(token, file))\n```\n\n你也可以用实现自己的`token缓存`, 实现这个`oauth.CacheMan`接口即可\n\n```go\ntype CacheMan interface {\n\tGet() (string, error)\n\tSet(string, int) error\n\tIsValid() bool\n}\n```\n\n最后在 `oauth.New` 的时候传入。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchekun%2Fbaidu-yuyin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchekun%2Fbaidu-yuyin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchekun%2Fbaidu-yuyin/lists"}