Question: I just tested the TTS feature and I'm really disappointed. While the text is mostly recognizable the quality of the sound is horrible.

There is too much noise and it sounds as if there is a lot of clipping as well. I know that TTS can never be as good as a pre-recorded sound file, but I think I'd be satisfied if at least the clipping could be fixed.

I'd try `KEY_PARAM_VOLUME` but it's only supported since API 11 (I use 8), so I'm not sure if that would fix the clipping issue.

Also I'm pretty sure that if I'm streaming the sound to a file the clipping gets stored as well, so no gain from doing that and then using `SoundPool`to play at a lower volume.

Are there any other ways to improve TTS quality?

Answer: 
You can do

```
myOption map { success } getOrElse handleTheError

```

or with `scalaz`,

```
myOption.cata(success, handleTheError)

```

where `success` is something like

```
def success(op: Whatever) = {
  doSomethingWith(op)
  Path(request.path) match {
    case "work"    => println("--Let's work--")
    case "holiday" => println("--Let's relax--")
    case _         => println("--Let's drink--")      
  }
}

```

### Update

Your pseudocode

```
x -> y match {
  case a -> c => {}
  case a -> d => {}
  case b => {}
}

```

can be literally translated to scala as

```
(x, y) match {
  case (a, c) => {}
  case (a, d) => {}
  case (b, _) => {}
}

```

It looks nice (and that's probably what you wanted) if inner matcher have only few options (`c` and `d` in this case), but it leads to code duplication (repeating of pattern `a`). So, in general I'd prefer `map {} getOrElse {}`, or separation of pattern-matchers on smaller functions. But I repeat, in your case it looks reasonable.
If the scrutinees (the expressions on which you match) do not depend on each other, i.e. you can compute them independently, you could perform both `match`es at the same time by wrapping the scrutinees in a tuple.

So your example:

```
x match {
 case a => {
   y match {
    case c => fooC(...)
    case d => fooD(...)
   }
 }
 case b => fooB(...)
}

```

could be rewritten as:

```
(x,y) match {
  case (a, c) => fooC(...)
  case (a, d) => fooD(...)
  case (b, _) => fooB(...)
}

```

...as long as `y` doesn't depend on `x`.