Git Product home page Git Product logo

Comments (8)

theorix avatar theorix commented on June 24, 2024 1

变成text是因为this.im.sysManage.sendRosterMessage({type: this.fileType, 这里的type不支持audio-mp3 , 可以把asyncFileUpload的fileType 设置为'audio-mp3', 然后sendRosterMessage的type设置为'audio'。
另外之前的把asyncFileUpload的fileType 设置为'audio',但是文件不是amr,这种会导致手机端无法播放。

from lanying-im-web.

theorix avatar theorix commented on June 24, 2024 1

好的 谢谢你的建议 我向相关人员反馈下

from lanying-im-web.

theorix avatar theorix commented on June 24, 2024

可以参考下面链接: https://github.com/maxim-top/maxim-web/blob/d80514407233e3a6917b462417c5a8aafbbdf7fd/src/ui/chatting/content/roster/inputer.vue#L96

im.sysManage.asyncFileUpload的参数fileType现在只支持mp3和amr: 如果文件为mp3格式,需要设置fileType为 'audio-mp3' ;如果为amr格式,需要设置fileType为 'audio'

from lanying-im-web.

spencer17x avatar spencer17x commented on June 24, 2024

如果要上传的话,这样录制的文件名怎么定义?这样会存在语音覆盖的问题

from lanying-im-web.

spencer17x avatar spencer17x commented on June 24, 2024

而且我试了下,fileType 为 'audio-mp3' 是无效的

from lanying-im-web.

theorix avatar theorix commented on June 24, 2024

文件名应该是你生成的,可以用时间戳和随机数保证不重复。asyncFileUpload的file参数需要传的是File对象 ( 见https://developer.mozilla.org/zh-CN/docs/Web/API/File/File ),audio-mp3 应该是有效的,无效是指报错了吗,有具体的错误信息吗。

from lanying-im-web.

spencer17x avatar spencer17x commented on June 24, 2024

@theorix 是file对象,上传 audio-mp3 会变成 text 的,设置 audio 就可以了。

from lanying-im-web.

spencer17x avatar spencer17x commented on June 24, 2024

这些问题是不是应该补充到文档里或者demo里会比较好,还有用户发送语音的时候还得走一遍上传,这是不是直接暴露一个 api 更好一些呢?貌似安卓端是一个api吧?

from lanying-im-web.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.