---
title: "TanStack AI Just Learned to Compose Music"
url: https://daily.dev/posts/tanstack-ai-just-learned-to-compose-music-e682grjys
source_url: https://tanstack.com/blog/tanstack-ai-audio-generation
type: article
source: "TanStack"
published: 2026-08-23T12:24:00.401Z
updated: 2026-08-23T12:56:51.818Z
tags: ["react", "typescript", "google-gemini", "tanstack"]
reading_time: 3
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TanStack AI Just Learned to Compose Music

**[TanStack](https://daily.dev/sources/tanstack-blog)** · 3 min read · 0 upvotes · 0 comments

## Summary

TanStack AI has released a new generateAudio() activity that provides a single typed API for AI-generated music, sound effects, speech, and transcription across providers. It ships with adapters for Gemini Lyria and fal (covering models like MiniMax, DiffRhythm, and Stable Audio 2.5), streaming support via SSE, and framework hooks for React, Solid, Vue, and Svelte. The API normalizes provider-specific quirks like differing duration parameter names and output formats (URL vs base64) so developers avoid writing repetitive glue code.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://tanstack.com/blog/tanstack-ai-audio-generation>

## Questions this post answers

### How do I generate music or sound effects in a React app using TanStack AI?

Use the new generateAudio() activity from @tanstack/ai with either the geminiAudio or falAudio adapter, passing a text prompt. It returns a GeneratedAudio object with either a url or b64Json field. In React, the useGenerateAudio hook from @tanstack/ai-react exposes generate, result, isLoading, stop, and reset for building a UI around it.

_Developers wiring AI audio generation into their apps can track framework updates like this on daily.dev._

### How does TanStack AI handle streaming for slow AI audio generation models like Stable Audio or Lyria?

generateAudio supports a stream: true option that returns an AsyncIterable of StreamChunk objects, which can be piped through toServerSentEventsResponse() for a single SSE connection delivering progress events and the final audio. This avoids blocking the UI while models like Lyria 3 Pro or Stable Audio, which take several seconds or longer, finish generating.

_Teams handling slow AI generation UX can follow patterns like this on daily.dev._

### Which AI audio models does the fal adapter for TanStack AI support?

The fal adapter in @tanstack/ai-fal supports multiple audio models in fal's catalog, including MiniMax, DiffRhythm, and Stable Audio 2.5, exposed through three tree-shakeable subpath adapters. TanStack AI normalizes differing parameter names across these models, such as music_length_ms, seconds_total, and duration, into one consistent typed interface.

_Comparing AI audio provider options is easier when developers track ecosystem changes on daily.dev._

## Similar posts on daily.dev

- [TanStack Releases Framework Agnostic AI Toolkit](https://daily.dev/posts/tanstack-releases-framework-agnostic-ai-toolkit-j747yitl6) · InfoQ · 1 upvotes · 0 comments

---

Tags: [#react](https://daily.dev/tags/react), [#typescript](https://daily.dev/tags/typescript), [#google-gemini](https://daily.dev/tags/google-gemini), [#tanstack](https://daily.dev/tags/tanstack)

[View this post on daily.dev](https://daily.dev/posts/tanstack-ai-just-learned-to-compose-music-e682grjys)
