Creates a new chat room via HTTP handler, validates request, persists room metadata, returns confirmation.
// Source: https://github.com/VoiceBlender/voiceblender | License: MIT | Copyright 2026 Messageroute Ltd
// Provided via justclaw.it.com; keep this notice with the code.
package api
import (
"context"
"fmt"
"net/http"
"time"
"github.com/VoiceBlender/voiceblender/internal/codec"
"github.com/VoiceBlender/voiceblender/internal/leg"
"github.com/VoiceBlender/voiceblender/internal/mixer"
"github.com/go-chi/chi/v5"
)
func (s *Server) doCreateRoom(req CreateRoomRequest) (RoomView, error) {
rate := req.SampleRate
if rate == 0 {
rate = s.Config.DefaultSampleRate
}
if !mixer.ValidSampleRate(rate) {
return RoomView{}, newAPIError(http.StatusBadRequest, "invalid sample_rate: must be 8000, 16000, or 48000")
}
room, err := s.RoomMgr.Create(req.ID, req.AppID, rate)
if err != nil {
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key