[KongchangAI]
· 2 min read· 1,463 words

DeepSeek Voice API Hands-On: Seamless Switching Across 10 Languages, Build a Voice Assistant for Under 1 Yuan

DeepSeek Voice API Hands-On: Seamless Switching Across 10 Languages, Build a Voice Assistant for Under 1 Yuan

DeepSeek voice API tested: ten languages auto-detected, but undocumented format, duration, streaming synthesis, and billing pitfalls need attention.

DeepSeek's newly released voice API offers two voices, Haixing and Anchao, supporting automatic detection of ten languages including Chinese, Cantonese, and English without manual labeling. By combining speech synthesis, speech recognition, web search, and file reading, a complete voice assistant can be assembled; first-token latency measured about 3 seconds, but real-time information like the date must be injected into context every time. Three undocumented pitfalls include: Chrome's default recording format isn't recognized and must be converted to WAV, recognition audio over 120 seconds throws an error, and streaming synthesis actually waits for text to finish sending before speaking. On billing, web search is charged by number of query terms, causing a mismatch between the interface display and the bill, and setting max tokens too small lets the search process consume the budget, resulting in an empty answer. Two rounds of testing cost under 1 yuan total—a low cost threshold—but before integrating into a product, you need to confirm checklist items like audio format conversion, long-audio segmentation, context injection, search billing, and output budget.

DeepSeek has taken a substantive step forward in voice interaction. The newly released voice API supports speaking ten languages with the same voice, and it can automatically detect the language, search the web, and read files aloud. After testing it with less than one yuan, a Bilibili creator discovered several pitfalls that aren't clearly documented—details that matter especially for developers who want to integrate it into products.

Two Voices, Ten Languages—No Need to Tell It What's Being Spoken

The API offers two voices: a female voice called "Haixing" and a male voice called "Anchao." The same sentence read in the two voices shows a clear stylistic difference, but both maintain a natural, fluent rhythm.

The most convenient part is automatic language detection. You don't need to label in advance "this is Cantonese" or "this is Arabic"—the model identifies it on its own. Testing covered ten languages: Chinese, Cantonese, English, Malay, Indonesian, Japanese, Korean, Thai, Vietnamese, and Arabic.

Chinese Cantonese English Malay

When the synthesized speech was fed back into speech recognition to convert it to text, among the first ten languages Chinese, Cantonese, English, Malay, and Indonesian came back word-for-word accurate, while Japanese, Korean, Thai, Vietnamese, and Arabic each had a few individual words misheard. A more everyday scenario is mixed Chinese-English—sentences like "last night I used cloud code to write a little game, pushed it to github, Vercel auto-deployed, and it went live in ten minutes" are read very smoothly, but when converted back to text, Vercel was heard as Vercel. Where proper nouns are dense, recognition results are actually best, which aligns with the intuition that language models rely heavily on context.

It Can Listen, Speak, and Connect to the Internet—Put Together, That's a Voice Assistant

Speech synthesis and speech recognition are nothing new on their own, but stringing them together with web search, web page reading, and file reading lets you assemble a complete voice assistant.

Can listen, can speak, can also connect to the internet

The creator tested it with their own voice: asking "What's the date today, will it rain in Hangzhou tomorrow," it took 4.7 seconds from finishing speaking to the model starting to talk, of which 0.9 seconds went to understanding the question, 3 seconds to produce the first character, and synthesis began immediately once the first sentence was written—without waiting for the entire text to finish generating. This streaming strategy keeps first-token latency within an acceptable range, and the date was answered correctly—provided that every conversation tells it "what's the date today."

Without date context, asking the same question six times yields five different dates, none of them correct. Moreover, this date message must be immediately adjacent to the user's question; inserting a system prompt in between causes the API to throw an error outright. This shows that the model itself has no built-in clock, and time awareness depends entirely on context injection.

Time to First Token (TTFT) is a key metric for voice interaction experience, referring to the interval between the user finishing their last word and the system outputting the first audio segment. In human conversation, natural turn-taking gaps are typically between 200 milliseconds and 1 second, and delays beyond 2 seconds feel noticeably laggy. In voice assistant scenarios, first-token latency consists of three parts: speech recognition time (audio-to-text), language model first-token generation time, and speech synthesis startup time. Of the 4.7-second total latency mentioned in the article, recognition accounts for 0.9 seconds, first-token generation about 3 seconds, and the remaining time goes to synthesis startup. The industry typically lowers this metric by running streaming recognition, streaming generation, and streaming synthesis as three parallel pipelines, but limited by model inference speed, most voice assistants today still have end-to-end first-token latency in the 2–4 second range.

Context injection is a common engineering technique in LLM applications, referring to providing the model—before the user's question, via a system prompt or preceding message—with real-time information not present in its training data, such as the current date, user location, account status, and so on. Because large language models' knowledge is cut off at the time of their training data, and they cannot actively obtain external real-time state during inference, any query involving "today" or "now" must rely on external injection. The phenomenon in the article where the date message must be immediately adjacent to the user's question and inserting a system prompt in between causes an error indicates that this API imposes strict constraints on message ordering; when constructing multi-turn conversations, developers need to pass dynamic context as an immediately adjacent user-side message or a specific role message, rather than inserting system prompts arbitrarily.

Three Pitfalls Not in the Docs: Format, Duration, Streaming Synthesis

Recognition doesn't accept Chrome's default recording format. Audio recorded by default in the Chrome browser is not accepted by the API; you need to convert it to WAV yourself before uploading.

Anything over 120 seconds throws an error outright. Speech recognition has a hard duration limit, so long audio must be segmented manually.

Streaming synthesis isn't "speak while outputting." The docs say it can produce sound while text is being sent, but in testing all three sending methods required waiting for the user to finish sending text before the model started speaking. So the voice assistant described earlier cuts text into sentences and synthesizes them one by one—it isn't truly input-while-output.

Got 5 different dates

Streaming synthesis (Streaming TTS) and streaming generation (Streaming LLM) are concepts at two different levels. Streaming generation means the language model outputs text token by token; streaming synthesis means the speech synthesis engine begins generating audio upon receiving partial text. Combined, they could theoretically enable "generate while speaking." But in actual systems, streaming synthesis often needs to wait for a complete semantic unit (such as a sentence or a clause) before starting, because speech synthesis depends on the prosody and context of the text, and overly short fragments lead to degraded audio quality or broken intonation. The phenomenon in the article where "it waits for the user to finish sending text before speaking" indicates that this API's streaming synthesis is not truly token-level streaming but batch processing per complete request; developers need to split calls by sentence themselves to simulate a streaming experience.

Two Billing Details Easily Overlooked on the Bill

Web search is done server-side, and reading web pages and files requires no implementation on your part, but there are two things to watch closely on the bill.

What's released this time is a full web search suite

The first is search count. The interface shows only one search, but the bill records 4, because billing is based on the number of query terms—one request carrying multiple query terms is charged as multiple.

The second is max tokens. When set to 300, money was spent and 6 searches were performed, but the answer was empty—the output budget was consumed by the search process and intermediate steps, leaving insufficient room for the final answer. Parameter settings need to leave headroom for search and can't be configured based on intuition from pure text generation.

max tokens is the parameter in LLM APIs that controls the output length of a single request, but its measurement range typically includes all tokens generated by the model, not just the final answer. In requests with web search, the model may need to first generate search query terms, then generate intermediate reasoning steps based on search results—all these tokens count toward the output budget. If max tokens is set too small, the budget may be exhausted during the search and reasoning stages, resulting in an empty final answer. The industry recommends setting max tokens to 2–3 times that of pure text generation scenarios when tool calling is enabled, or adjusting dynamically based on query complexity, to ensure the final answer has enough output space.

The Checklist Worth Preparing Before Integrating Into a Product

The two rounds of testing cost less than one yuan in total—a very low cost threshold—but to integrate this API into a real product, you need to confirm at least a few things: whether the audio format conversion pipeline is ready, whether the long-audio segmentation strategy is clear, whether real-time information like the date is injected every time, whether search billing is estimated by query terms, whether max tokens leaves enough room for the final answer, and whether streaming synthesis calls are split by sentence. The creator organized these into a checklist that can be used directly from a screenshot.

At a cost of less than one yuan, you get a voice assistant prototype that speaks ten languages, can search the web, and can read files—a very impressive return on investment. The remaining question isn't "can it be done," but "what will you build with it."

#DeepSeek voice API#speech synthesis#speech recognition#multi-language voice assistant#web search billing#max tokens#streaming synthesis#TTFT
Share:

Related articles