Beyonce has spoken about the tragedy of her miscarriage for the first time.

The 31-year-old has opened up about the loss in her upcoming documentary, Life Is But a Dream.

“About two years ago, I was pregnant for the first time,” she says in one scene.

“And I heard the heartbeat, which was the most beautiful music I ever heard in my life.”

“I picked out names…I envisioned what my child would look like. I was feeling very maternal.”

The singer, who is married to rapper Jay-Z, reveals that she lost the baby in the early stages of her pregnancy.

“I flew back to New York to get my check up – and no heartbeat, she says. “Literally the week before I went to the doctor, everything was fine, but there was no heartbeat.”

She recalls turning to music to get her through those tough times.

“I went into the studio and wrote the saddest song I’ve ever written in my life…and it was the best form of therapy for me, because it was the saddest thing I’ve ever been through.”

In 2011, she was thrilled to discover she was pregnant again, which she revealed to the world at the MTV Video Music Awards in August of that year.

“Being pregnant was very much like falling in love. You are so open. You are so overjoyed.

She also addressed rumours that she was faking the pregnancy by wearing a fake baby bump and choosing to use a gestational surrogate.

“A stupid rumour, the most ridiculous rumor I’ve ever had about me,’ she says. ‘To think that I would be that vain…” She shared photos of her pregnant belly and sonogram with the documentary, which airs on HBO in the US on February 16.

Their daughter Blue Ivy was born in January 2012, admiting she was “scared to death” of giving birth, but describing it as “the most beautiful experience of my life.”

“You’re playing a part in a much bigger show.”