# Can we set blocks with live (like interface)?

**URL:** <https://discuss.huggingface.co/t/can-we-set-blocks-with-live-like-interface/37329>\
**Category:** 🔒 Gradio\
**Created:** [April 21, 2023, 9:56am UTC](https://discuss.huggingface.co/t/can-we-set-blocks-with-live-like-interface/37329 "2023-04-21T09:56:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![laro1](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@laro1](https://discuss.huggingface.co/u/laro1)\
**Post date:** [April 21, 2023, 9:56am UTC](https://discuss.huggingface.co/t/can-we-set-blocks-with-live-like-interface/37329/1 "2023-04-21T09:56:25Z")

</div>

We can set the live parameter in interface:

```auto
demo = gr.Interface(
    main_note,
    gr.Audio(source="microphone", streaming=True),
    gr.Text(),
    live=True
)

```

How can we set `live` with blocks ?

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [April 21, 2023, 9:13pm UTC](https://discuss.huggingface.co/t/can-we-set-blocks-with-live-like-interface/37329/2 "2023-04-21T21:13:15Z")

</div>

hi @laro1  
here is an example using a Camera, but you can replace with the Audio

```python

import gradio as gr
import numpy as np

def flip(im):
    return np.flipud(im)

with gr.Blocks() as demo:
  with gr.Row():
      with gr.Column():
        camera = gr.Image(source="webcam")
      with gr.Column():
        image = gr.Image()
  camera.stream(fn=flip, inputs=[camera], outputs=[image])

demo.launch()

```
