# 推流至语音频道

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /chatroom/v3/channel/stream/push:
    post:
      summary: 推流至语音频道
      deprecated: false
      description: ''
      tags:
        - HTTP接口/在线媒体流
      parameters:
        - name: client_type
          in: query
          description: 声明请求黑盒语音
          required: true
          example: heybox_chat
          schema:
            type: string
            default: heybox_chat
        - name: x_client_type
          in: query
          description: 声明客户端类型
          required: true
          example: web
          schema:
            type: string
            default: web
        - name: os_type
          in: query
          description: 声明客户端类型
          required: true
          example: web
          schema:
            type: string
            default: web
        - name: x_os_type
          in: query
          description: 声明客户端是bot
          required: true
          example: bot
          schema:
            type: string
            default: bot
        - name: x_app
          in: query
          description: 声明请求黑盒语音
          required: true
          example: heybox_chat
          schema:
            type: string
            default: heybox_chat
        - name: chat_os_type
          in: query
          description: 声明客户端是bot
          required: true
          example: bot
          schema:
            type: string
            default: bot
        - name: chat_version
          in: query
          description: 客户端版本号,不同版本返回的结果可能有区别
          required: true
          example: 1.30.0
          schema:
            type: string
            default: 1.30.0
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                room_id:
                  type: string
                  description: 房间ID
                channel_id:
                  type: string
                  description: 频道ID
                stream_url:
                  type: string
                  description: 源流URL
                volume:
                  type: integer
                  description: 音量，取值范围[0, 100]，默认100，表示原音量。
                operator:
                  type: integer
                  description: 操作用户的UID
                callback_url:
                  type: string
                  description: 回调链接 详见文档
                seek_second:
                  type: integer
                  description: 指定视频从某个秒时间戳播放
                repeat_num:
                  type: integer
                  description: 循环播放次数, 取值范围[-1, 1000], 默认1次, -1为循环播放。线路2 不支持播放次数
                max_duration:
                  type: integer
                  description: 循环播放最大时长,仅支持RepeatNum设置-1时生效，取值范围[1, 10080]，单位分钟。
              required:
                - channel_id
                - stream_url
                - operator
                - room_id
              x-apifox-orders:
                - room_id
                - channel_id
                - stream_url
                - volume
                - operator
                - callback_url
                - seek_second
                - repeat_num
                - max_duration
            example:
              room_id: '3886418517665415168'
              channel_id: '3886418645352636424'
              stream_url: >-
                https://dlink.host/musics/aHR0cHM6Ly9vbmVkcnYtbXkuc2hhcmVwb2ludC5jb20vOnU6L2cvcGVyc29uYWwvc3Rvcl9vbmVkcnZfb25taWNyb3NvZnRfY29tL0VXODJiQUJPRHcxRGh0cW9Lb0RlUHdVQi1JNmE3bWVXdnpHZEZqbXUxVkdoQXc.mp3
              volume: 30
              operator: 8829829
              callback_url: https://yourdomain.com/callback
              seek_second: 10
              repeat_num: 2
              max_duration: 233
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  msg:
                    type: string
                  result:
                    type: object
                    properties:
                      task_id:
                        type: string
                        description: 任务ID 操作任务的唯一凭证
                    required:
                      - task_id
                    x-apifox-orders:
                      - task_id
                  status:
                    type: string
                required:
                  - msg
                  - result
                  - status
                x-apifox-orders:
                  - msg
                  - result
                  - status
              example:
                msg: ''
                result:
                  task_id: >-
                    VmKuXYqynxHc+BHhOWtI5srKrZl7mV9CbhVM7KgFflnIEuUuEKNsjpLzB6DWdZuaL0t030+nrUzarKGmqR6dgAz+K9lrsNsCYjKpnqkbnlyzeXGTRMmp+ecUhAMGvtvy
                status: ok
          headers: {}
          x-apifox-name: 成功
      security:
        - apikey-header-token: []
      x-apifox-folder: HTTP接口/在线媒体流
      x-apifox-status: developing
      x-run-in-apifox: https://app.apifox.com/web/project/4856361/apis/api-320947489-run
components:
  schemas: {}
  securitySchemes:
    token:
      type: apikey
      in: header
      name: token
      token: ODYzNzY0NDM7MTc1NTc1OTk1NzYyODYzNjQ0NzsxNTU0MDM2NTkxNzk2OTM1OTY5
    apikey-header-token:
      type: apiKey
      in: header
      name: token
servers:
  - url: http://prod-cn.your-api-server.com
    description: 正式环境
security:
  - apikey-header-token: []

```
